Skip to content

AlanChurley1/tmgNodeBoilerPlate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TMG Node api Boilerplate

When to use this boilerplate

  • When running an api, or simlilar project that only has feed outputs
  • When a html front end is not required

When NOT to use this boilerplate

  • Projects that have a user interface
  • SPA applications
  • Projects that do not require a web-server
  • Projects that will do large amounts of data manipulation

Setup

Installation

  1. Install Node/NPM at version 6.9.4
  2. Install yarn globally (npm install -g yarn)
  3. Inside project folder run yarn

Running in development

Port defaults to 3000, but can be overidden by setting PORT environment variable

Developmet environment can be run using

yarn start

this will start a local server and run nodemon to watch for any changes, and automatically restart the server

Test

Test scripts can be executed by running

yarn test

Build/Serve

For non development environments bable should be pre-run to aid performace

yarn build

This will build a pre-comiled version of the app inside the dist folder

yarn serve

This will serve the static assets from the dist folder

Development

Introduction

The project is build using babel and using an expressjs server.

Code should be written in es6, which is then compiled down as part of the build process.

Routes

All routing is configured inside app/index.js, using standard express routing

full documentation is avaliable at https://expressjs.com/en/api.html#express.router

Static assets

Any static assets that are to be served "as is", should be placed inside the app/static folder. Sub folders are served using the same folder structure as they are in the file system

Tests

Tests are currently built using node assert as the main test tool, please see documentation at https://nodejs.org/api/assert.html

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published