Skip to content

A simple REST API application, implemented in rust programming language. The four API's (GET, POST, PUT, DELETE) are implemented. MongoDB is used as database.

License

Notifications You must be signed in to change notification settings

GaneshJadhavOnGitHub/REST-API-using-Rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

REST-API-using-Rust

A simple REST API application, implemented in rust programming language. The four API's (GET, POST, PUT, DELETE) are implemented. MongoDB is used as database.

Application takes information for a movie and calculates Verdict of that Movie.

Features :-

  1. Input and Business Validations are done.
  2. Error Handling is done.
  3. Rolling JSON logs are provided.

⚠️ Important Note on CORS (Cross-Origin Resource Sharing)

CORS (Cross-Origin Resource Sharing) is an HTTP protocol mechanism that allows servers to specify which origins (domains, schemes, or ports) are permitted to access resources on the server. It is primarily used to enable secure cross-origin requests, such as when a web application on one domain requests resources hosted on another domain.

This REST API currently does not have CORS (Cross-Origin Resource Sharing) functionality implemented.

Please refer HELP folder for any kind of help.


To run application. Refer HELP\Application_Requirements.txt for system requirements.

Clone the repository.

Download MongoDB community server zip package for windows. Extract ZIP. Create a folder to store database. We will call this folder as 'db' Go to bin folder of MongoDB. bin folder is located at the location where we have extracted MongoDB community server zip package.
Execute following command inside bin folder from command prompt. mongod --dbpath="<Path of 'db' folder>" Above steps will start MongoDB Server.

Use MongoDB Compass to import data. Download and extract MongoDBCompass and run MongoDBCompass.exe Enter connection string for database server running locally. mongodb://localhost

Create Database and Collection and then Import Data using MongoDBCompass.

Refer Help\DatabaseHelp folder for Database Schema and Collection.

In VS Code Open Thunder Client, select Collections. Click Menu at the right side and select Import. Import JSON requests collection. This collection is present in file 'thunder-collection_MoviesJSON.json'.

Build and Run

cargo build

cargo run

Send requests from Thunder Client.


OUTPUT :-

  1. POST

POST

  1. GET

GET

  1. PUT

PUT

  1. DELETE

DELETE


Releases

No releases published

Packages

No packages published

Languages