Skip to content
This repository has been archived by the owner on Feb 7, 2021. It is now read-only.

A simple NodeJS table reservation backend API, using Express, Knex and MySQL

Notifications You must be signed in to change notification settings

olehmelnyk/table-reservation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

table-reservation

A simple NodeJS table reservation backend API, using Express, Knex and MySQL


Requirements:

  • NodeJS
  • MySQL

#Get up and running:

cd ~/Desktop

git clone [email protected]:olehmelnyk/table-reservation.git

cd table-reservation

npm run firstrun

Server should start on localhost:3000


#REST ###GET /api/reservations/:id Return reservation by id

{
    "id": 234,
    "table_id": 1,
    "reservation_start": "2019-10-10T21:10:00.000Z",
    "reservation_end": "2019-10-10T21:15:00.000Z",
    "guests": 8
}

###POST /api/reservations Create a new reservation

{
	"startDate": "2019-10-11 00:10:00",
	"endDate": "2019-10-11 00:15:00",
	"guests": 8
}

Returns reservation ID

###PUT /api/reservations/id Update reservation by id

{
	"startDate": "2019-10-11 00:10:00",
	"endDate": "2019-10-11 00:15:00",
	"guests": 8
}

###DELETE /api/reservations/id Delete reservations by id


#TODO:

  • fix SQL for selecting free tables
  • add data validation
  • refactor, restructure, modularise
  • move all settings/variables to config file
  • mode dev DB seeds/etc to dev folder

About

A simple NodeJS table reservation backend API, using Express, Knex and MySQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published