Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danielivanovz/recipe-server
A NodeJS, Express, and MongoDB REST API to deliver recipes scraped with Recipe Scraper
https://github.com/danielivanovz/recipe-server
mongodb nodejs pino recipe-scraper typescript
Last synced: about 2 months ago
JSON representation
A NodeJS, Express, and MongoDB REST API to deliver recipes scraped with Recipe Scraper
- Host: GitHub
- URL: https://github.com/danielivanovz/recipe-server
- Owner: danielivanovz
- Created: 2021-05-24T20:37:57.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-28T08:36:09.000Z (over 3 years ago)
- Last Synced: 2024-04-28T05:58:45.663Z (9 months ago)
- Topics: mongodb, nodejs, pino, recipe-scraper, typescript
- Language: TypeScript
- Homepage:
- Size: 138 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
recipe server
A NodeJS, Express and MongoDB REST API to deliver recipes scraped with Recipe Scraper
## Installation
Run the following script in your terminal, it will create a folder containing the script and install dependencies.
```sh
git clone --depth=50 --branch=main https://github.com/heyiamZer0/recipe-server.git heyiamZer0/recipe-server recipe-server && cd heyiamZer0/recipe-scraper && yarn
```
create your .env file:```sh
vim .env
```
press `i` to start insert mode and define your enviroment variables:* URI = `mongodb+srv://databaseMongo:[email protected]/DATABASE?retryWrites=true&w=majority`
* PORT = `<#PORT to run the server at>`
* DB_NAME = `MONGO_DATABASE_NAME`
* DB_COLLECTION = `MONGO_DATABASE_COLLECTION`to exit and save, hit `esc` and `:wq`
## Start the server
```sh
yarn devTS
```## Usage
Example for `GET` /id with ID `1234` on the local database using the recipes scraped with [Recipe Scraper][recipe-scraper] will return:
[recipe-scraper]:https://github.com/heyiamZer0/recipe-scraper
```typescript
{
_id: 1234
title: String
image: String
ingredients: [{
ingredient: String
quantity: String
}]
description: [{
step: Number
instructions: String
}]
calories: null || Number
category: String
difficulty: String
time: Number
}
```## Built With
* [NodeJS][nodejs] - runtime environment
* [Express][express] - framework
* [MongoDB][mongodb] - mongodb native driver
* [TypeScript 4.0][typescript] - codebase
* [Pino][pino] - logging[nodejs]:https://github.com/nodejs/node
[express]:https://github.com/expressjs/express
[mongodb]:https://github.com/mongodb/node-mongodb-native
[typescript]:https://github.com/microsoft/TypeScript
[pino]:https://github.com/pinojs/pino## Related projects
- [Recipe Scraper][recipe-scraper]
- [Recipe React App][react-app][recipe-scraper]: https://github.com/heyiamZer0/recipe-scraper
[react-app]: https://github.com/heyiamZer0/recipier-react## License
Distributed under the MIT License. See `LICENSE` for more information.