0

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

Rodrigo Medeiros
  • 7,814
  • 4
  • 43
  • 54
user3251111
  • 43
  • 1
  • 4

1 Answers1

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
  • 1
    Note 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