Route
Don't forget to return to HttpResponse from the route
Route-middleware route
import Route from 'nanoexpress/src/Route';
const route = new Route();
app.use(route);
route.get('/', async () => 'hello world');const Route = require('nanoexpress/cjs/Route');
const route = new Route();
app.use(route);
route.get('/', async () => 'hello world');if you want Route to work properly, first initialize via app.use(routerInstance) then registrate your routes
Async route
Basic Async example
app.get('/', async () => ({ status: 'success' }));DB example
Basic example
JSON example
Last updated
Was this helpful?