Giter VIP home page Giter VIP logo

express-basic-app's Introduction

Express Basic Application

Introduction:

This project will give you a scaffolding/boilerplate of the node/express/socket.io stack. It uses mongodb for database models and redis for session storage. Fork at will! :)

express basic application

Built with:

Testing:

Dependencies:

Install dependencies:

  • brew/apt-get install nodejs
  • brew/apt-get install redis
  • brew/apt-get install mongodb
  • npm install -g mocha
  • npm install -g gulp
  • npm install

Environment variables:

  • PORT - Port exposed by this component.
  • example: 3000
  • DEBUG - Debug output (* for all) (optional)
  • example: *
  • NODE_ENV - Environment ('development', 'staging', 'production')
  • example: development
  • CLIENT_API_PATH - Path to the client REST api (relative)
  • example: /api
  • APPSECRET - Application session secret
  • example: sOmeCrAzYhAsH894372
  • SESSION_KEY - Application session secret (optional)
  • example: express.sid (defaults to connect.sid)
  • REDIS_URL - Redis url (including authentication)
  • example: redis://user:pass@localhost:6379
  • REDIS_DB - Redis database number (optional)
  • example: 1
  • REDIS_SESSION_PREFIX - Prefix for redis session entries (optional)
  • example: sess:
  • MONGO_URL - MongoDB url (including authentication)
  • example: mongodb://user:pass@localhost:27017/mydatabase

Run tests:

  • npm test

Run the application:

  • set environment variables
  • gulp
  • (create a shellscript with the above for convenience if you want)
  • navigate your browser to http://localhost:3000 (or whatever port you chose for PORT)

Development shellscript example:

#!/bin/sh
export PORT=3000 \
export DEBUG="*:-engine:polling" \
export NODE_ENV="production" \
export APPSECRET="somecrazyhash" \
export CLIENT_API_PATH="/api" \
export SESSION_KEY="express.sid" \
export MONGO_URL="mongodb://localhost/express-basic-app" \
export REDIS_URL="redis://localhost:6379" \

gulp develop

express-basic-app's People

Contributors

eiriklv avatar

Watchers

Marcel Araujo avatar James Cloos 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.