The application takes a viaply URL for a movie and returns the URL to the trailer of the movie.
The application is deployed on Heroku.
The Open API 3 docs will be available on /docs
route.
curl -X 'GET' \
'https://trailer-service.herokuapp.com/trailer?link=https://content.viaplay.se/pc-se/film/arrival-2016' \
-H 'Authorization: Basic ZGV2OmRldg=='
npm i
npm t
will run the tests using tap
.
npm run dev
runs the server in dev mode using nodemon. It should just work.
npm start
is more proper way to start the application. Don't forget to provide the required environment variable TMDB_API_KEY
when running this way.
The /trailer
route is behind basic authorization. Default username/password is dev:dev
.
env | default | required |
---|---|---|
PORT | 3000 | |
NODE_ENV | local | |
BASIC_AUTH_USERNAME | dev | |
BASIC_AUTH_PASSWORD | dev | |
TMDB_API_KEY | INVALID_API_KEY | ✅ |
- Add mocking to the tests so that we don't hit real APIs for testing
- Cache movie data since it should not change frequently (eg: Out of band cache).