Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Express Basics Deeper into Routing with Express POST Requests

What is the command to launch the web server when running this app?

I can't fins the section where Andrew teacher how to launch the web server that serves these page we are building in this section.

I figured it out. It's just: node app.js

If you already installed nodemon I think is nodemon app.js

1 Answer

A little late to the game here, but just to clarify for anyone else - in some of the earlier exercises, Andrew had us install nodemon via the terminal / console. nodemon always starts the file you've identified against "main" in the package.json file:

{
  "name": "treehouse-flashcards",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.15.2",
    "pug": "^3.0.2"
  }
}

So, as long as you're in the root directory, if you just enter nodemon into the terminal / console, it should launch app.js (as we've specified above in the package.json file). Weeeeeeeeeeeeee