1.0.5 • Published 2 years ago

jellyo-express-template v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

express-template

This is a basic Express.js application generated using Express Generator. It sets up a simple application with an organized directory structure and pre-configured middleware.

Getting Started

To get started, first install all the necessary dependencies.

npm install

Add in the following:

In config.mjs (if you are using MongoDB in your project):

export const config = {
  database: {
    url: "",
  }
};

In app.mjs (if you require sessions in your project):

app.use(
  session({
    secret: "",
    resave: false,
    saveUninitialized: true,
    cookie: { secure: "auto" }
  })
);

Start the development server:

npm run dev

By default, browser-sync starts the server on http://localhost:3000. Browser-sync maps the port your server is listening on to port 3000.

Start the server without nodemon or browser-sync:

npm start

This starts a server on localhost, on the port that your node server is listening on.

File Structure

Here is the main structure of the project:

.
├── app.mjs
├── config.mjs
├── package.json
├── public
│   ├── img
│   ├── js
        └── script.js
│   └── css
│       └── styles.css
├── routes
│   ├── index.js
└── views
    ├── index.ejs

Scripts

  • npm start: Runs node app.mjs
  • npm run nodemon: Runs nodemon -e * app.mjs; Refreshes the server on save
  • npm run sync: Runs browser-sync; Refreshes browser on save
  • npm run dev: Combines both nodemon and browser-sync

License

MIT License

Copyright (c) 2023 Jellyyyyyyy

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago