-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update README.md with useful information
- Loading branch information
1 parent
eb55fca
commit ddf2712
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,23 @@ | ||
# Simple Test API | ||
|
||
## Main Goal | ||
Useful in code tests: | ||
- main uri reveals `/api/` uri | ||
- `/api` returns random http status code | ||
- for tests, `/api/418` returns 418 http status code | ||
- if http status code is between `100` and `399` returns image uri | ||
- if http status code is `5xx` randomly drops connection | ||
|
||
## Requirements | ||
- `node` and `npm` | ||
- `.env` for local running | ||
- `PORT=3000` or other as you wish | ||
- `API_KEY` from [Pexels API](https://www.pexels.com/api/) - to get random image URI | ||
- for remote hosting I'm using [Heroku](https://dashboard.heroku.com/) | ||
|
||
## How to use locally | ||
- `npm install` | ||
- set `.env` variables | ||
- `node index.js` | ||
- open `http://localhost:3000` (replace `3000` with your `.env PORT` config) | ||
|