Useful in code tests:
- main uri reveals
/api/uri /apireturns random http status code- for tests,
/api/418returns 418 http status code - if http status code is between
100and399returns image uri - if http status code is
5xxrandomly drops connection- with additional parameter
/api/5xx/1connection was not dropped (useful for tests)
- with additional parameter
nodeandnpm.envfor local runningPORT=3000or other as you wishAPI_KEYfrom Pexels API - to get random image URI
- for remote hosting I'm using Heroku
npm install- set
.envvariables node index.js- open
http://localhost:3000(replace3000with your.env PORTconfig)