DEV Community

Ali Zulfaqar
Ali Zulfaqar

Posted on • Edited on

1

ExpressJS application generator

Introduction

Hello and welcome to my 2nd post, this post is to share how you can streamline your files and folder for Express application generator. With Express application generator, you can have your files and folder up in no time. And make sure you have the basic knowledge for setting up backend file and folder such as npm init to make server.js file as this is just a tool to help simplify the process of setting up express files and folder

Installation steps

In the project directory, you can run:

npx express-generator

and you will have the folder and files as below
.
├── app.js
├── bin
│ └── www
├── package.json
├── public
│ ├── images
│ ├── javascripts
│ └── stylesheets
│ └── style.css
├── routes
│ ├── index.js
│ └── users.js
└── views
├── error.pug
├── index.pug
└── layout.pug

7 directories, 9 files

After the files and folder has been created, run below command

npm install

this will install all require dependency package from package.json

npm start

to run the express file

Conclusion

For anyone who is interested to dive in ExpressJS without headache to create new model, controller and routes. I recommend use express generator to get a grip of how the files and folders are structured. From there you can get familiar on how ExpressJS works

SurveyJS custom survey software

Simplify data collection in your JS app with a fully integrated form management platform. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more. Integrates with any backend system, giving you full control over your data and no user limits.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs