Creating a new Express project with express-generator
Very similar to Angular-CLI, there is a command line tool to quickly create a new Express project called express-generator
. We will use express-generator to create a new Express web server project to serve as the back-end of our blog application. We will eventually integrate this back-end web server with our front-end Angular project to create a full-stack JavaScript web application.
Getting ready
First, we will need to install both Express and express-generator
with NPM. If you haven't already, you will also need to install the latest version of Node.js and NPM package manager:
npm install -g express express-generator
How to do it...
Let's perform the following steps to create a new Express web server:
- First, let's create a new Express project using express-generator's
express
command:
express my-express-project
- A new Express project will be scaffolded out in the
/my-express-project
directory. After installation, we will need to install our...