From the course: Learn JavaScript: Write Modern Code with JavaScript ESNext

Unlock this course with a free trial

Join today to access over 25,000 courses taught by industry experts.

Create and set up a Node.js project

Create and set up a Node.js project

- Okay, so now that we know a little bit more about what our server is going to do, let's start creating it. The first thing we're going to do is create and set up the project that all our source code is going to be in. So in order to do that, open up the IDE of your choice. The one I'm going to be using is Visual Studio Code, which has a built-in terminal that I'll be using, as well. And what we're going to do is create a new folder, and we'll call that folder something like node-rest-api. And once we've done that, click Open, and now it's time to set up our project so that it'll run correctly. The first thing we have to do is open up a terminal inside this folder. Make sure you really are running these commands inside the correct folder. That happens to me sometimes. And what we're going to do is run npm init -y, which initializes this folder as a new npm package and creates this package.json file for us that contains a little bit of information about our project. And once we've…

Contents