This article will show how to install an application using Express framework in Linux Ubuntu. Actually, this article will use Linux Ubuntu 18.10 as the operating system to perform the installation. In this article, creating the application will be done using a generator tool at first. The generator tool is the Express Generator where the information for the installation exist in this link. The application itself will use an EJS template engine. Basically, according to this link, there are several template engines available. According to that link, some popular template engines that work with Express are Pug, Mustache, and EJS. The Express application generator uses Jade as its default, but it also supports several others. In this context, the template engine will use ‘ejs’ as its template engine. The following is the step for creating the application powered by Express Application using EJS template engine :
1. Install Express Generator. The link is available to get the information.
- Execute the following command to generate the application skeleton :
express --view=ejs myapp
The above command is the command to create an application with the name of ‘myapp’ using ‘ejs’ as the template engine. For an example, the following is the execution of the above command pattern :
3. Check the result by executing the following command :
user@hostname:~/express$ ls myapp user@hostname:~/express$ cd myapp/ user@hostname:~/express/myapp$ ls app.js bin package.json public routes views user@hostname:~/express/myapp$
Just use the normal command as in the above command execution. A folder with the name of ‘myapp’ exist along with the content inside of it. It is the application skeleton as a result of the above express generator execution command.