Giter VIP home page Giter VIP logo

ldserver2's Introduction

ldserver2


Table of contents:


Dependencies

required:

  • npm + nodejs runtime
  • openssl
  • tree
  • pm2
  • sqlite3
  • bcrypt

nodejs dependencies:

  • Express webserver framework for node.js
  • Helmet secure http headers
  • Bodyparser parse incoming data and make it available under req.body property
  • ip IP address utilities for node.js
  • Passport* Authentication modules
  • Express-session carry session throughout client connection

Quickstart

systems packages

  • clone repo
  • change '.env-example' into '.env'
  • update .env file and replace all values with own 'complex' strings
you can use this to generate keys
cd ./api/utils
node genKey.js

init (do these from root directory of repo)

npm run certs
npm install --save
node initDB.js

start server

node server.js

visit http(s)://[localhost]:[port]/



Daemonize Server

This command installs pm2, a process manager to let processes or servers run in the background
npm install pm2 -g

..then inside ldserver2's root directory

pm2 start server.js --name 'helloWorld'

Commands:

  • pm2 ls Shows running processes
  • pm2 monit Monitor processes
  • pm2 delete [id|name] kill the daemon ie. pm2 delete 0 or pm2 delete helloWorld
  • pm2 --help for all commandline options
  • pm2 start server.js --watch Restarts server on source changes (development)
  • pm2 stop [id|name] --watch Stops restarting on source changes
  • cat ./bin/pm2-status.sh Quick guide

DOCS

git pull This will update local repo to latest version

Scripts:

  • create-certs.sh This script creates and places cert + key into your application this requires openssl

  • tree.sh A script to show the output as a visual formatted tree on server startups

  • pm2-status.sh A script, but really a documentation to daemonize the webserver

  • ip.js & local_ip.sh A script to retrieve and set localip automatically

  • log.js & tree.sh A script to give fancy info when starting up the server

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.