Skip to content

Commit 59e6e57

Browse files
committed
Splits private and public APIs
The private API is under /editor and the public API under /api
1 parent 3c23fee commit 59e6e57

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
API_URL=/api
1+
API_URL=/editor
22
AWS_ACCESS_KEY=<your-aws-access-key>
33
AWS_REGION=<your-aws-region>
44
AWS_SECRET_KEY=<your-aws-secret-key>

app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
],
1717
"env": {
1818
"API_URL": {
19-
"value": "/api"
19+
"value": "/editor"
2020
},
2121
"AWS_ACCESS_KEY": {
2222
"description": "AWS Access Key",

server/server.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,19 @@ app.use(session({
9797
app.use(passport.initialize());
9898
app.use(passport.session());
9999
app.use('/api/v1', requestsOfTypeJSON(), api);
100-
app.use('/api', requestsOfTypeJSON(), users);
101-
app.use('/api', requestsOfTypeJSON(), sessions);
102-
app.use('/api', requestsOfTypeJSON(), files);
103-
app.use('/api', requestsOfTypeJSON(), projects);
104-
app.use('/api', requestsOfTypeJSON(), aws);
100+
app.use('/editor', requestsOfTypeJSON(), users);
101+
app.use('/editor', requestsOfTypeJSON(), sessions);
102+
app.use('/editor', requestsOfTypeJSON(), files);
103+
app.use('/editor', requestsOfTypeJSON(), projects);
104+
app.use('/editor', requestsOfTypeJSON(), aws);
105105

106106
// This is a temporary way to test access via Personal Access Tokens
107107
// Sending a valid username:<personal-access-token> combination will
108108
// return the user's information.
109-
app.get('/api/auth/access-check', passport.authenticate('basic', { session: false }), (req, res) => res.json(req.user));
109+
app.get(
110+
'/api/v1/auth/access-check',
111+
passport.authenticate('basic', { session: false }), (req, res) => res.json(req.user)
112+
);
110113

111114
app.use(assetRoutes);
112115
// this is supposed to be TEMPORARY -- until i figure out

0 commit comments

Comments
 (0)