Giter VIP home page Giter VIP logo

bay-backend's Introduction

hBAY

Install NVM

-sudo apt-get update
-sudo apt-get install build-essential libssl-dev
-curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh -o install_nvm.sh
-nano install_nvm.sh
-bash install_nvm.sh
-source ~/.profile
-nvm ls -remote
-nvm install 8.15.0
-nvm use 8.15.0

Install Node Packages

-npm install

Run tests using NPM

npm tests

Linting made with eslint

npm run pretest

Fix any linting error found

npm run pretest -- --fix    

Run Instanbul

istanbul cover test/test.js

Logging made with chalk package

i.e log(chalk.blue('Server is running'));

Run coverage using instanbul

istanbul cover test.js

install mongodb

install mongodb for your system

Run the application to test the endpoints

install nodemon server i.r npm install -g nodemon
run it by issuing the following command i.r nodemon server

Public endpoints

POST http://localhost:3000/users/register -data  { username: "menty", password: "menty44" }
POST http://localhost:3000/users/authenticate -data  { username: "menty", password: "menty44" }

Private endpoints

GET http://localhost:3000/api/profiles
POST http://localhost:3000/api/patch -data { title: "menty", message: "menty44" }
GET http://localhost:3000/api/thumbnail

Dockerhub url for the dockerized application

https://cloud.docker.com/repository/docker/menty44/hackerbay 

Pull the container from the hub

docker pull menty44/hackerbay

Check the images to see if cloning was successful

docker images

Run the docker image

docker run -p 49160:8080 -d menty44/hackerbay i.e it should be running on http://localhost:8080 

If you need to go inside the container you can use the exec command

docker exec -it <container id> /bin/bash i.e the app should be under this path /usr/src/app

bay-backend's People

Contributors

menty44 avatar

Watchers

 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.