Resepin RESTful API is an API that allows users to read recipe information data from a database. The Food Recipe RESTful API also allows users to create, update, and delete recipe information to/from the database.
- Node Js
- Express JS
- Postman
- Web Server (ex. localhost)
- Code Editor (VS Code, Sublime, Atom, etc)
Node.js is a software that designed to develop web-based applications and is written in the syntax of the JavaScript programming language. JavaScript as a programming language that runs on the client / browser side only can be completed by Node.js. With Node.js, JavaScript can also act as a programming language that runs on the server side, such as PHP, Ruby, Perl, and so on.
Node.js can run on Windows, Mac OS X and Linux operating systems without the need for program code changes. Node.js has its own HTTP server library that make it possible to run a web server without using a web server program such as Apache or Nginx.
Express.js is one of the most popular web frameworks for Node.js. The complete documentation and its use which is quite easy, can make us develop various products such as web applications or RESTful API.
- Clone or download this repository
- Open app's directory in CMD or Terminal.
- Type in Terminal
npm install
to install the required packages. - Make a new file, .env and setup the file. instruction here
- Turn on Web Server and PostgreSQL, (Also can be done with third-party tools like XAMPP, WAMP, etc)
- Setup the database. instruction here
- Open Postman desktop application or Chrome web extension (Install Postman if you haven't yet)
- Choose HTTP Method and enter the request URL.(i.e. localhost:5000/recipe)
- Check all Endpoints here
Open .env file on code editor and copy the code below :
# app
SERVER_PORT=4000
# database
DB_HOST="Your_Host"
DB_USERNAME="Your_Username"
DB_PASSWORD="Your_Password"
DB_DATABASE ="Your_Table"
DB_PORT = "Your_port_DB"
# jwt
SECRET_KEY = "secret key you"
# cloudinary
CLOUDINARY_CLOUD_NAME = "cloud name"
CLOUDINARY_API_KEY = "api key "
CLOUDINARY_API_SECRET = "secret key"
Parameter | Type | Description |
---|---|---|
id |
string |
Required. Id of item to fetch |
GET /food
Parameter | Type | Description |
---|---|---|
search |
string |
Required. Your API key |
limit |
number |
Required. Your API key |
sort |
string |
Required. Your API key |
page |
number |
Required. Your API key |
Wahyu Dwi Purwanto - linkedin - wahyu.aan2508@gmail.com
Distributed under the MIT License.