Giter Club home page Giter Club logo

emac-tech-test's Introduction

README - Lizzo’s Juicy Juice Bar - The Server

Prerequisites

  • Node
  • npm

Getting Started

Before attempting anything, ensure you have run npm i in this directory to install all dependencies.

Testing

All tests are in the test directory. We use jest and supertest to test our server. Run npm t to execute tests.

Prior to testing the file ./data/data.json needs to be replaced with a copy of the file ./data/VANILLA-data.json
This 'initializes' the data available for the tests.
This can be achieved by running the following bash commands from the project folder.

rm ./data/data.json
cp ./data/VANILLA-data.json ./data/data.json

Running Dev Server

Run npm run dev to run the development server. It is configured to run on localhost:9090 by default.

Endpoints

  • /api

    • GET - Returns status 200 and an ok message when the server is online
  • api/recipes

    • GET - Returns status 200 and a full list of recipes
    • POST - Providing a recipe JSON object adds the recipe to the data
  • api/recipes?exclude_ingredients=ingredientsString

    "ingredientsString" is of the form "item1,item2,..." -- Example: "exclude_ingredients=flax,oat%20milk"

    • GET - Returns status 200 and a list of recipes but with the specified items removed from the ingredients of each recipe
  • api/recipes/:id

    ":id" is a valid recipe ID

    • GET - Returns status 200 and a an object containing the specified recipe

emac-tech-test's People

Contributors

sssam-c avatar good4something-6 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.