A starter project generated with the Express CLI
Install Node.js using insructions in this gist.
Clone the repo:
$ git clone [email protected]:MichaelCurrin/express-quickstart.git
$ cd express-quickstart
$ npm install
Start the local dev server.
$ npm start
Open in the browser:
- Homepage: http://localhost:3000
- Users endpoint: http://localhost:3000/users
Using the Express create app CLI.
See more info on the Expression generator in the docs.
Run the quickstart template generator. You can run this without installing it first.
$ npx express-generator
e.g.
$ mkdir my-app
$ cd my-app
$ npx express-generator
Or
$ npx express-generator my-app
$ cd my-app
For earlier versions of Node.js, install globally and then run.
$ npm install -g express-generator
$ express .
You can choose a view engine.
- Default:
jade
- Options:
ejs|hbs|hjs|jade|pug|twig|vash
- Example:
--view=pug
See the Pug.js homepage for how to use .pug
files.
The main
field does not seem to serve a purpose but it was added by the template I think so I've left it.
The entrypoint ends up actually being src/bin/www
as per the start
script command.
- Express.js homepage
- Node.js (Express) with TypeScript, Eslint, Jest, Prettier and Husky - Part 1 blog post
Released under MIT by @MichaelCurrin.