https://github.com/olgaprikhodko/drink-service-api-lab
Using the ExpressJS library to create a Web API to serve back JSON Responses based on a HTTP Request. Using a Test-Driven approach and TS.
https://github.com/olgaprikhodko/drink-service-api-lab
Last synced: 3 months ago
JSON representation
Using the ExpressJS library to create a Web API to serve back JSON Responses based on a HTTP Request. Using a Test-Driven approach and TS.
- Host: GitHub
- URL: https://github.com/olgaprikhodko/drink-service-api-lab
- Owner: OlgaPrikhodko
- Created: 2023-03-07T09:41:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-07T13:09:33.000Z (over 2 years ago)
- Last Synced: 2025-01-19T19:14:41.646Z (5 months ago)
- Language: TypeScript
- Size: 98.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DRINKS SERVICE API
## Install
npm install
## Run the app
npm start
## Run the tests
npm test
## Possible Requests:
### Request
`GET /`
### Response
"Welcome to the Drinks API!"
### Request
`GET /coffeelover`
### Response
"I like coffee!"
### Request
`GET /coffee`
### Response (get "Latte" by default)
`{
"drinkType": "Coffee",
"name": "Latte"
}`### Request with parameter
`GET /coffee/?coffeeName=mocha`
### Response
`{
"drinkType": "Coffee",
"name": "mocha"
}`#### Request with parameter
`GET /tea/?teaName=Black`
#### Response
`{
"drinkType": "Tea",
"name": "Black"
}`#### Request with parameter
`GET /tea`
#### Response
`{
"drinkType": "Tea",
"name": "Green"
}`