Skip to content

A bash script that gives you the ability to quickly initialize a Node JS server that uses the Handlebars HTML templating engine.

Notifications You must be signed in to change notification settings

JarEXE/nodebars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Download the Script

(Right click the button and choose "Save link as").

download

Description

This script simplifies the process of initializing a new Node.js project for fellow Handlebars enjoyers. It includes about 10 Handlebars helper functions that I have used quite frequently.

Details

The script will:

  • Create standard directories typically used for a new Node server.
  • Install some of the most common NPM packages.

⚠️ Node and NPM must already be installed on your device

List of Packages Installed

  • express
  • nodemon
  • dotenv
  • body-parser
  • path
  • express-handlebars
  • express-session
  • express-flash
  • axios

You will be prompted to choose whether to include Bootstrap and SweetAlert2 assets in your public assets directory.

After the script completes, a new folder named my-node-server_<date+time> will be created in your project directory. You may want to rename it to something more meaningful.

Instructions

  1. Download the script into your desired project directory.
  2. Make sure the script is executable:
    chmod +x new-handlebars-project.sh
  3. Run the script:
    ./new-handlebars-project.sh
  4. Start your Node server with:
    node app.js
    The server will run on port 9876. This port can be configured in your .env file.

If the name sucks, then rename the script as you see fit.

Using Nodemon

To utilize nodemon, edit the package.json scripts to include:

"start": "nodemon app.js"

Then start your Node.js server with:

npm start

Customization

Feel free to customize this script to better suit your needs, such as adding additional packages or improving file templates. Editing the script should be straightforward.

Contributions and Suggestions

If you have any suggestions or contributions on how to improve this script, feel free to make suggestions or contribute.

About

A bash script that gives you the ability to quickly initialize a Node JS server that uses the Handlebars HTML templating engine.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages