Reputation: 13089
When using Express normally you use app.post('/path')
or app.get('/path')
to define routes.
Does Express also provide a function to define routes like this app.route('POST', '/path')
(where route
is the function I'm looking for)?
Upvotes: 0
Views: 84
Reputation: 5056
You can programmatically select method with bracket notation. For example:
app['post']('/path')
app['post']('/path-2')
app['get']('/path')
Upvotes: 1