Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/programyazar/rust_news_api

Rust News Api
https://github.com/programyazar/rust_news_api

Last synced: 7 days ago
JSON representation

Rust News Api

Awesome Lists containing this project

README

        

# Rust Language Restfull News API

### Please read: Of course, I have not implemented all the functions such as paging, ... but in the source code you can find place holders for this purpose. This is just a demo project designed to interview only.



# Project


* This project use Rocket Framework for api design, http requests like json request,...
* i've created a very basic file cache system for caching
* I use GNews api for backend

## Instructions:
* Install rust via
```shell
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

* Get an api key from GNEWS developer portal.

## Run Project

### For development test command:
```shell
API_KEY="blablabla" cargo run
```
-----------

### For release test command:
```shell
API_KEY="blablabla" cargo run --release
```
-----------

\
\
\
Restfull api endpoints for local development machine:

```shell
$ curl "http://127.0.0.1:8000/searchByTitle/Best%20Programmer"
$ curl "http://127.0.0.1:8000/searchByDescription/Best%20Programmer"
$ curl "http://127.0.0.1:8000/searchByContent/Best%20Programmer"
```

\
\
Ofcouse, I didnt implement all functions like paging, ... but in source code you can find place holders for this purpose.
This is only demo.

## todo
* add an dotenv file for configuration
* add comments for functions
* implement all functions
* create an uml or flowchart for presentation