diff --git a/server/src/routes/api/register.ts b/server/src/routes/api/register.ts index 3c8bd01..dd24268 100644 --- a/server/src/routes/api/register.ts +++ b/server/src/routes/api/register.ts @@ -1,6 +1,5 @@ import type { Application } from 'express' import type { ApiHandler } from '../../types' - import getEndpoints from './get' import deleteEndpoints from './delete' import postEndpoints from './post' @@ -39,4 +38,9 @@ export function registerApis(app: Application) { app[method](prependApiPath(endpoint.path), endpoint.handler) }) }) + + // Fallback, for SPA mode + app.get('*', (_, res) => { + res.redirect('/') + }) }