diff --git a/.env.example b/.env.example index 7680fb90..0385cf26 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -API_URL=/api +API_URL=/editor AWS_ACCESS_KEY= AWS_REGION= AWS_SECRET_KEY= diff --git a/app.json b/app.json index a588258e..3eff82c9 100644 --- a/app.json +++ b/app.json @@ -16,7 +16,7 @@ ], "env": { "API_URL": { - "value": "/api" + "value": "/editor" }, "AWS_ACCESS_KEY": { "description": "AWS Access Key", diff --git a/server/server.js b/server/server.js index af6ea25a..a7acc387 100644 --- a/server/server.js +++ b/server/server.js @@ -97,16 +97,19 @@ app.use(session({ app.use(passport.initialize()); app.use(passport.session()); app.use('/api/v1', requestsOfTypeJSON(), api); -app.use('/api', requestsOfTypeJSON(), users); -app.use('/api', requestsOfTypeJSON(), sessions); -app.use('/api', requestsOfTypeJSON(), files); -app.use('/api', requestsOfTypeJSON(), projects); -app.use('/api', requestsOfTypeJSON(), aws); +app.use('/editor', requestsOfTypeJSON(), users); +app.use('/editor', requestsOfTypeJSON(), sessions); +app.use('/editor', requestsOfTypeJSON(), files); +app.use('/editor', requestsOfTypeJSON(), projects); +app.use('/editor', requestsOfTypeJSON(), aws); // This is a temporary way to test access via Personal Access Tokens // Sending a valid username: combination will // return the user's information. -app.get('/api/auth/access-check', passport.authenticate('basic', { session: false }), (req, res) => res.json(req.user)); +app.get( + '/api/v1/auth/access-check', + passport.authenticate('basic', { session: false }), (req, res) => res.json(req.user) +); app.use(assetRoutes); // this is supposed to be TEMPORARY -- until i figure out