Commit 80389e09 authored by Geovanny's avatar Geovanny

Added /api to api url calls

parent aaea74a2
......@@ -23,10 +23,10 @@ app.keys = [ENV.SESS_KEY]
app.use(bodyParser());
app.use(session(SESS_CONFIG, app));
router.use('/unit', unitRouter.routes(), unitRouter.allowedMethods());
router.use('/user', userRouter.routes(), userRouter.allowedMethods());
router.use('/api/unit', unitRouter.routes(), unitRouter.allowedMethods());
router.use('/api/user', userRouter.routes(), userRouter.allowedMethods());
authRouter.use('/user', userAuthRouter.routes(), userAuthRouter.allowedMethods());
authRouter.use('/api/user', userAuthRouter.routes(), userAuthRouter.allowedMethods());
app.use(router.routes()).use(router.allowedMethods());
......
class Sync{
async login(credentials){
const login_response = await fetch('/user/login', {
const login_response = await fetch('/api/user/login', {
method: "POST",
body: JSON.stringify(credentials),
headers: {
......@@ -16,7 +16,7 @@ class Sync{
}
async register(credentials){
const register_response = await fetch('/user/register', {
const register_response = await fetch('/api/user/register', {
method: "POST",
body: JSON.stringify(credentials),
headers: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment