Coder Social home page Coder Social logo

hygge-api's Introduction

Update the creds in credentials.js

  • NODESMITH_API= to your end point.
  • PRIVATE_KEY = private key to your wallet.

Babel 7 Node API Starter base

  • Babel 7 so you can use all the babel goodness you want on your server
  • Nodemon for your development reloading bliss
  • Morgan for your logging needs
  • Helmet to help secure your application
  • Jest for testing & coverage
  • Prettier and ESLint for formatting and linting
  • Husky for git hooks

Running your API

  • npm start and start coding
  • Save your files and the server will automatically reload

Running your tests

Unit Tests

  • npm test
  • See Jest docs for how to write your tests
  • See /src/main/controller.test.js for an example of a test

Coverage

npm run coverage

Deploying your API

  1. npm run build to create a build of your code
  2. npm run serve to serve the code up from your /build directory

Logs

  • Logs use morgan for formatting the messages
  • All logs will be output into the /logs directory
  • Rotation policy on both app.log and error.log is 10Mb and/or 1 day
  • 4xx & 5xx errors will be placed into your error.log
  • All traffic will be recorded in app.log

Configuring logs

  • /src/express/logs.js contains the logging setup
  • You can add a new rotation policy (see rotating-file-stream for options)
  • You can also add another express middleware for writing new/different logs

Routing

  • Any routes.js file within the /src directory will automatically be picked up on application load
  • See /src/main/routes.js for an example

hygge-api's People

Contributors

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