paint-brush
Build Simple Express Js Application in 1 Minute with create-express-appby@getspooky
580 reads
580 reads

Build Simple Express Js Application in 1 Minute with create-express-app

by Yasser Ameur El IdrissiMay 3rd, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Build Simple Express Js Application in 1 Minute with create-express-app. The tool allows installing ready to use Expres.js application, with all needed dependencies. It's super easy to create our first application using the create-Express-app tool. By default, the application is open at localhost:4200. I'm a full stack web developer with the skills & knowledge necessary to create user-friendly, intera by Yasser Ameur El Idrissi.

Company Mentioned

Mention Thumbnail
featured image - Build Simple Express Js Application in 1 Minute with create-express-app
Yasser Ameur El Idrissi HackerNoon profile picture

Express.js is one of the most popular back-end frameworks nowadays, which lots of people find useful to learn. After mastering the theory, it comes the time to start the practice, and then it may seem a little bit difficult, how to start. But creating your first Express.js application doesn’t have to be so complicated.
Let’s start...

1. Install create-express-app

In the beginning, we have to install create-express-app tool. which allows installing ready to use Expres.js application, with all needed dependencies. To install the tool, we have to use the following command in the command line:

npm install -g create-expressjs-app

After the process finished successfully, you have it installed. Let’s create our app!

2. Create the application

Now, it’s super easy to create our first application using the create-express-app tool. We can do it with a single command in our command line. First, navigate to the folder where you want to have your application through the command line, and then run the following command, where expressapp is the name of our application:

create-expressjs-app init expressapp

When you create a new app, the CLI will use npm to install dependencies. If you have npm installed, but would prefer to use yarn , you can append --use yarn or -u yarn to the creation command. For example:

create-expressjs-app init expressapp --use yarn 

You will be prompted to pick a template. Supported template are :

  • cra-template-es5
  • cra-template-es6
  • cra-template-typescript.

You can feel free to set a different name for your application. If the process finished successful, you should have your folder with the app ready! Let’s start the application now!

3. Start the application

Let’s start our expressapp with the following commands:

npm run start

The first command is used to enter to the folder of our application, and the second one starts our app. By default, the application is open at localhost:4200

I hope you will find this tutorial helpful and use it as a base for your first
If you would like to contribute to create-express-app please feel free to check out the Contributing guidelines about how to proceed.

Have a nice coding!