Code Monkey home page Code Monkey logo

e-coffee's Introduction

swenson-he-e-Coffee-challenge

Swenson HE BackEnd Challenge

Installation Instructions

To get this backEnd up and running, do the following:

  • run npm install
  • create a file .env on the root directly, containing the list below
    • MONGODB_URL={MONGODB_URL_YOU_WANT_TO_USE}
    • MONGO_DATABASE_NAME={DATABASE_NAME_YOU_WANT_TO_USE}
    • ENVIRONMENT= production || development
    • COFFEE_MACHINE_SCRIPT_LOADED=false
    • COFFEE_PODS_SCRIPT_LOADED=false
  • After you have provided the environment variable details, run this command,
    • npm run dev
    • when the server starts up, it will create thecoffeeMachines and cofffeePods collections.
    • confirm they were created, by checking your database.
    • if collections were created, stop the server with ctrl+c, and change the following environment variables;
      • COFFEE_MACHINE_SCRIPT_LOADED=true
      • COFFEE_PODS_SCRIPT_LOADED=true
    • afterwards, restart the server with npm run dev

API DOcumentation:

Coffee Machines:

verb path desc
get /getByProductType/:productType get machines by type only
get /getByWaterline/:waterLineCompatible get machines by water line compatibility only
post /createCoffeeMachine create new coffee machine

Coffee Pods:

verb path desc
get /getCoffeePodsBy/type/:productType get Pod by type only
get /getCoffeePodsBy/flavor/:coffeeFlavor get Pod by flavor only
get /getCoffeePodsBy/size/:packSize get Pod by pack size only
get /getCoffeePodsBy/type/:productType/flavor/:coffeeFlavor get Pod by type and flavor only

Running Tests

To run test, enter the command below: npm run test

e-coffee's People

Contributors

hdarwish avatar

Watchers

James Cloos 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.