Skip to content

dlblom/BackEndMiniChallenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BackEndMiniChallenge

Use this repo to practice writing RESTful CRUD routes. Simulate client interactions using Postman Postman. The goal of this mini challenge is to make all tests pass and practice error handling in an express server. See requirements section below for challenge details.

Installation

To get started:

Navigate to the project Directory

$ cd BackEndMiniChallenge

Install the dependencies

$ npm install

In a new terminal, seed the database

$ mysql -u root -p < schema.sql;

Start the server

$ npm run start

Before running the tests, create and use the test database

$ CREATE DATABASE pets_info_test;
$ USE pets_info_test;

Run the tests

$ npm run test

Requirements

In order to make the tests pass in this exercise, you'll need to complete both the server routes (server/index.js) and the database helper functions (databse/index.js).

METHOD PATH DESCRIPTION
GET /api/pets respond with all the pets
GET /api/pets/:id respond with single pet, based on req.params.id
POST /api/pets inserts new pet record from req.body
PUT /api/pets/:id updates a pet record from req.body
PATCH /api/pets/:id updates specific section of a pet record from req.body
DELETE /api/pets/:id deletes a pet record based on req.params.id

Technologies

Express MySQL Jest Supertest

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors