https://github.com/varun-verma-code/express-es6-template
Express template using module/ES6 syntax
https://github.com/varun-verma-code/express-es6-template
Last synced: about 1 year ago
JSON representation
Express template using module/ES6 syntax
- Host: GitHub
- URL: https://github.com/varun-verma-code/express-es6-template
- Owner: varun-verma-code
- License: gpl-3.0
- Created: 2024-11-20T00:41:57.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-18T22:07:05.000Z (over 1 year ago)
- Last Synced: 2025-02-14T05:19:19.783Z (over 1 year ago)
- Language: JavaScript
- Size: 69.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# express-es6-template
Express template using module/ES6 syntax
After cloning the library, execute these commands to install dependencies
`npm install`
`npm audit fix --force`
If you do not have nodemon installed, install by executing
`npm -g install nodemon`
**Directory and file structure**
```text
/LocalLibrary
app.js
/bin
www
package.json
package-lock.json
/node_modules
[about 6700 subdirectories and files]
/public
/images
/javascripts
/stylesheets
style.css
/routes
index.js
users.js
/views
error.pug
index.pug
layout.pug
```
- **package.json** - Defines application dependencies. Defines the startup script that calls the application’s entry point, the JS file **/bin/www**
- **/bin/www** - Application’s entry point. Sets up some basic error handling and then loads app.js to do the rest of the work
- **/routes** - The app routes are stored as separate modules under this directory
- **/views** - The templates are stored under this directory
The default view installed by express is Jade. But you can choose a different template e.g. pug during your installation. The following dependencies are added by express
- [cookie-parser](https://www.npmjs.com/package/cookie-parser): Used to parse the cookie header and populate `req.cookies` (essentially provides a convenient method for accessing cookie information).
- [debug](https://www.npmjs.com/package/debug): A tiny node debugging utility modeled after node core's debugging technique.
- [morgan](https://www.npmjs.com/package/morgan): An HTTP request logger middleware for node.
- [http-errors](https://www.npmjs.com/package/http-errors): Create HTTP errors where needed (for express error handling).