Skip to content

Commit

Permalink
Update README.md with useful information
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioBeneditto committed Feb 25, 2022
1 parent eb55fca commit ddf2712
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
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)

0 comments on commit ddf2712

Please sign in to comment.