Skip to content

michealnaita/node-by-pirple

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Website Tracker Restful API

This project is inspired by a course on Nodejs i took by Pirple

This uses in built node modules that are shipped with node to create a website tracker reastful api from srcatch.

Features

  • Create, Read, Update and Delete Users
  • Token Based Authentication
  • Background workers to check website status and alert user on status change
  • File based database
  • Custom templating engine
  • Application logging

How to run API

  1. Clone repository and cd into folder

    git clone https:github.com/michealnaita/node-by-pirple api && cd ./api
  2. Add data and logs folders

    mkdir -p ./.data/checks ./.data/tokens ./.data/users ./.logs/checks ./.logs/errors
    
    
  3. set enviromental variables for application In your terminal

     ACCOUNT_SID=[your-twilio-account-sid]
     AUTH_TOKEN=[your-twilio-auth-token]
     HTTP_PORT=[prefered-http-port-number]
     HTTPS_PORT=[prefered-https-port-number]
     NODE_ENV=development
  4. make sure that node is installed on your system

    node --version

    or folow installation guide

  5. Run application

    node index.js
  6. Test using Postman

    Note: All routes are protected therefore you need to create account get token, then set token in header under the key: token

Routes

  • /api/users

    • allowed methods: GET, POST, PUT, DELETE
  • /api/checks

    • allowed methods: GET, POST, PUT, DELETE
  • /api/tokens

    • allowed methods: GET, POST, PUT, DELETE
  • /ping

    • allowed methods: GET

Credits

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published