One option to create a server without much difficulty is to use the modules: express-Generator on Node.
The express-Enerator can be installed by typing the command:
$ npm install express-generator -g
Creating the structure of the project:
$ express exemplo-express -e ejs
A similar structure will be created in your root directory.
exemplo-express/
├── bin/
├── public/
│ ├── images/
│ ├── javascripts/
│ ├── stylesheets/
├── routes/
│ ├── index.js
│ ├── users.js
├── views/
│ ├── error.ejs
│ ├── index.ejs
├── app.js
├── package.json
After that, you will need to install all the dependencies that are in package.json.
{
"name": "myapp",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
Papa install the dependencies just type in the console the following command:
$ npm install
Once done, your server will already be created and ready to use and the server can be started with the command:
$ npm start
I don’t use text formatting much because I am visually impaired and can’t visually track every formatting, style, etc. What well to do is to choose font, color, minimal things.
– André Nascimento