Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Move server API routes to /api/ path? #509

Closed
pdehaan opened this issue Aug 11, 2017 · 0 comments · Fixed by #537
Closed

Move server API routes to /api/ path? #509

pdehaan opened this issue Aug 11, 2017 · 0 comments · Fixed by #537

Comments

@pdehaan
Copy link
Contributor

pdehaan commented Aug 11, 2017

Ref: #506 (comment)

We should only render the notfound page for HTML endpoints; some of the 404s are API endpoints and will not be expecting a notfound HTML page.

Not sure if we should rename some API routes in server/server.js so all API routes are under some /api/ prefixed path so they are a bit more obvious.

Proposal:

CURRENT PROPOSED
app.get('/exists/:id', ...) app.get('/api/exists/:id', ...)
app.get('/assets/download/:id', ...) app.get('/api/download/:id', ...)
app.post('/delete/:id', ...) app.post('/api/delete/:id', ...)
app.post('/upload', ...) app.post('/api/upload', ...)

But I don't think this would apply to the following routes:

  • app.get('/')
  • app.get('/unsupported/:reason')
  • app.get('/legal')
  • app.get('/jsconfig.js')
  • app.get('/download/:id')
  • app.get('/__lbheartbeat__')
  • app.get('/__heartbeat__')
  • app.get('/__version__')
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant