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
and399
returns image uri - if http status code is
5xx
randomly drops connection- with additional parameter
/api/5xx/1
connection was not dropped (useful for tests)
- with additional parameter
node
andnpm
.env
for local runningPORT=3000
or other as you wishAPI_KEY
from Pexels API - to get random image URI
- for remote hosting I'm using Heroku
npm install
- set
.env
variables node index.js
- open
http://localhost:3000
(replace3000
with your.env PORT
config)