Giter Site home page Giter Site logo

node-express-template's Introduction

Node-Express-Template

A template for creating fast and secure Express Applications. Content Security Policy has been set up using Helmet. Compression has been added using the node middleware Compression The template has been setup to use Bootstrap CSS and Bootstrap-native Javascript as a CDN but will fall back on local copies if the CDN is unavailable. Both CDN's have been allowed through the CSP Bootstrap-native has been used for added performance. Bulky j-query and popper libraries are not required

Installation

Clone or download and unzip this repository. Change the parent directory to your own application's name. Navigate to your parent directory and run

npm init

Answers the questions when prompted

Essential Packages

If you haven't already installed them run these commands from your root directory

npm install express --save
npm install pug --save

Optional Packages for Security and Performance

If you want a fast and secure website I highly recommend using CSP and compression. Run these commands from your root directory

npm install compression --save
npm install helmet --save

If you are not going to use these packages, don't forget to remove the imports and usage lines from app.js

From the parent directory run node app.js Open up your browser and goto localhost:3000 where you will find your app running.

Make it your Own

  • Edit the views/home pug template to show your homepage
  • Further routes should be added to the routes.js file
  • Further pug templates should inherit from global.pug As this contains the head section and bootstrap imports.
  • Google analytics should be added to the head section of global.pug

node-express-template's People

Contributors

neil-brown avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.