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

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

@pdehaan

Description

@pdehaan

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__')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions