Hi I was just wondering when does app.get('/', routes.index)
or app.post('/add', routes.add)
run in node.js based express app?
Asked
Active
Viewed 123 times
0

Rodrigo Medeiros
- 7,814
- 4
- 43
- 54

user3251111
- 43
- 1
- 4
1 Answers
2
.get runs when you make a HTTP GET request and .post for when HTTP POST request. You can use .all for both requests. So you can replace verb
in app.verb
with any HTTP verbs.

clouddreams
- 622
- 1
- 4
- 13
-
1Note that you can also do "app.use(app.router);" to force them to be loaded ahead of time. http://stackoverflow.com/a/13255316/446681 – Hector Correa Jan 30 '14 at 01:24