diff options
Diffstat (limited to 'src/services')
-rw-r--r-- | src/services/AuthService.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/services/AuthService.js b/src/services/AuthService.js new file mode 100644 index 0000000..626a8fb --- /dev/null +++ b/src/services/AuthService.js | |||
@@ -0,0 +1,17 @@ | |||
1 | import axios from "axios"; | ||
2 | |||
3 | const url = 'http://localhost:8000/api/auth/' | ||
4 | |||
5 | export default { | ||
6 | async login(data) { | ||
7 | return await axios | ||
8 | .post(url+'login/', data) | ||
9 | .then(res => res.data) | ||
10 | }, | ||
11 | |||
12 | async register(data) { | ||
13 | return await axios | ||
14 | .post(url+'register/', data) | ||
15 | .then(res => res.data) | ||
16 | } | ||
17 | } \ No newline at end of file | ||