Skip to main content

Additional Routing Methods

There are two main methods of creating routes (And a third method advanced method discussed here)

const app = new EzBackend();
const base = new EzApp();

base.get('/method1', async (req, res) => {
return { hello: 'world' };

base.setHandler('Method 2', async (instance, opts) => {
instance.server.get('/method2', async (req, res) => {
return { hello: 'world' };

app.addApp('base', base);


Both methods are the same, however each method has their pros and cons

1Shorter SyntaxNo instance access
2Instance accessLonger Syntax

There are several other methods for creating routes as well, for exampl