GithubHelp home page GithubHelp logo

gdgvit / hades-beta-backend Goto Github PK

View Code? Open in Web Editor NEW
0.0 9.0 0.0 2 MB

Simple REST API for storing registered emails for Hades beta

License: GNU General Public License v3.0

JavaScript 99.06% Shell 0.94%
nodejs hades javascript mongodb mongoose express

hades-beta-backend's Introduction

Node.JS template

A template to quickstart Node.JS REST APIs

Tests codecov

Functionality

  • Idiomatic and configurable logging
  • Response compression
  • Sane linting and styling guidelines
  • Continuous integration using github actions
  • Tests
  • Code coverage

Running the server

npm start

Note: This will run a server in the development environment. For information on deploying an express application to production, take a look here.

Logging

This directory has 2 files.

  • logger.js exports a winston object which we use for logging. You should modify logger.js to customize your logging configuration.
  • morgan.js exports a pre-configured morgan object to write logs using a stream to winston. It is used to intercept http requests and log the request and response details. For more details, visit the official page for morgan.

Routes

Directory for defining routes. I don't think this needs more explanation.

Additional Information

  • On Linux, UNIX and Mac, running the following command adds ./node_modules/.bin to the path.

    source ./activate

    This makes it easier to run locally installed command packages. This won't be required in many IDEs like Webstorm, but we thought it's a good idea to include it anyway.

  • standard.js has been added as the default linting and styling tool.

    Usage:

    npm run lint

    Formats the entire project, and logs out anything it couldn't fix.

  • mocha is used for testing and chai is used for assertion. chai-http is used to test http endpoints.

    Run all tests using:

    npm test
  • nyc is used as the default coverage tool.

    Upload coverage report to codecov using:

    npm run coverage

    Note: You will need to add the CODECOV_TOKEN to your repository secrets for GitHub actions to work well, and export it as an environment variable to run it locally.

Dependencies

Dependency Usage
body-parser POST body parsing middleware. Adds body object to incoming request
compression Response compression middleware
express Express REST API framework
morgan HTTP request logger
winston General purpose logger for the application
nyc Code Coverage tool
standard Linting and styling tool.
chai Assertion Library
chai-http Middleware for chai to test http endpoints

hades-beta-backend's People

Contributors

bro3886 avatar dependabot[bot] avatar snyk-bot avatar sphericalkat avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.