Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cbdiscord
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Geovanny E. Vera Pazmino
cbdiscord
Commits
80389e09
Commit
80389e09
authored
May 14, 2020
by
Geovanny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added /api to api url calls
parent
aaea74a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
main.js
server/main.js
+3
-3
sync.js
web/login/sync.js
+2
-2
No files found.
server/main.js
View file @
80389e09
...
@@ -23,10 +23,10 @@ app.keys = [ENV.SESS_KEY]
...
@@ -23,10 +23,10 @@ app.keys = [ENV.SESS_KEY]
app
.
use
(
bodyParser
());
app
.
use
(
bodyParser
());
app
.
use
(
session
(
SESS_CONFIG
,
app
));
app
.
use
(
session
(
SESS_CONFIG
,
app
));
router
.
use
(
'/unit'
,
unitRouter
.
routes
(),
unitRouter
.
allowedMethods
());
router
.
use
(
'/
api/
unit'
,
unitRouter
.
routes
(),
unitRouter
.
allowedMethods
());
router
.
use
(
'/user'
,
userRouter
.
routes
(),
userRouter
.
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
());
app
.
use
(
router
.
routes
()).
use
(
router
.
allowedMethods
());
...
...
web/login/sync.js
View file @
80389e09
class
Sync
{
class
Sync
{
async
login
(
credentials
){
async
login
(
credentials
){
const
login_response
=
await
fetch
(
'/user/login'
,
{
const
login_response
=
await
fetch
(
'/
api/
user/login'
,
{
method
:
"POST"
,
method
:
"POST"
,
body
:
JSON
.
stringify
(
credentials
),
body
:
JSON
.
stringify
(
credentials
),
headers
:
{
headers
:
{
...
@@ -16,7 +16,7 @@ class Sync{
...
@@ -16,7 +16,7 @@ class Sync{
}
}
async
register
(
credentials
){
async
register
(
credentials
){
const
register_response
=
await
fetch
(
'/user/register'
,
{
const
register_response
=
await
fetch
(
'/
api/
user/register'
,
{
method
:
"POST"
,
method
:
"POST"
,
body
:
JSON
.
stringify
(
credentials
),
body
:
JSON
.
stringify
(
credentials
),
headers
:
{
headers
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment