DEV Community

Cover image for Creating & Running Expressjs Projects With create-express-app
Yasser Ameur el idrissi
Yasser Ameur el idrissi

Posted on

Creating & Running Expressjs Projects With create-express-app

Create Express App is a command-line interface tool that helps you to initialize, develop and maintain your Expressjs applications. It offers a modern build setup with no configuration. At the same time, it still offers the flexibility to tweak the config of each tool.
Starting new Express projects used to be a huge hassle — there were dozens of dependencies, configuration files, and other up front requirements before you could even start writing a single line of code.
Install it on your machine
You’ll need to have Node >= 8.10 on your local development machine Installation is done using the npm install command:

npm install -g create-expressjs-app

It’s really simple to create a new app — simply run create-expressjs-app followed by the desired name of your application, and it will scaffold a new app for you. Lets try it out:

create-expressjs-app init my-app

The folder my-app was created by create-express-app and houses all of our new application's code. The project layout should look like this:

├── README.md
├── node_modules
├── package.json
├── .gitignore
├── public
│   ├── favicon.ico
│   ├── index.html
|   ├── logo64.png
|   ├── logo128.png
│   └── logo256.png
└── src
    ├── App.js
    └── App.test.js
Enter fullscreen mode Exit fullscreen mode

Building & running an application
npm start
Runs the app in development mode. Open http://localhost:3000 to view it in the browser.
npm build
Convert TypeScript or ECMAScript 2015+ code into a backwards compatible version of JavaScript
npm test
Runs the test watcher in an interactive mode.
We encourage you to contribute to create-expressjs-app!
GitHub
Happy Coding !

Top comments (0)