You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 21, 2021. It is now read-only.
Currently, only very basic server logic can be implemented comfortably using Ream. Maybe using an enhance-server.ts file, server hooks could be used to implement for example middleware. Just one example:
// enhance-server.tsexportconstonCreatedApp=({ server })=>{server.post('/api/register',(req)=>{db.users.add({username: req.query.username})})constwebsocket=newmyWebsocketMiddleware()server.use(websocket)}
Or possibly consolidated with the pages/api/ system:
// pages/api/users.tsimport{server}from'@ream/server'server.use(authMiddleware)// middleware all /api/users/* routesserver.post('/register',handleRegistration)// mapped to /api/users/register
The text was updated successfully, but these errors were encountered:
Currently, only very basic server logic can be implemented comfortably using Ream. Maybe using an
enhance-server.ts
file, server hooks could be used to implement for example middleware. Just one example:Or possibly consolidated with the
pages/api/
system:The text was updated successfully, but these errors were encountered: