https://github.com/tarunbatra/trailer-service
Returns links to trailers for movies
https://github.com/tarunbatra/trailer-service
Last synced: 9 months ago
JSON representation
Returns links to trailers for movies
- Host: GitHub
- URL: https://github.com/tarunbatra/trailer-service
- Owner: tarunbatra
- Created: 2021-10-02T23:36:55.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-04T00:20:09.000Z (about 4 years ago)
- Last Synced: 2025-01-12T10:26:58.864Z (10 months ago)
- Language: JavaScript
- Size: 154 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# trailer-service
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](https://trailer-service.herokuapp.com/docs).
## Docs
The Open API 3 docs will be available on `/docs` route.
## Example
```sh
curl -X 'GET' \
'https://trailer-service.herokuapp.com/trailer?link=https://content.viaplay.se/pc-se/film/arrival-2016' \
-H 'Authorization: Basic ZGV2OmRldg=='
```
## Install deps
`npm i`
## Run tests
`npm t` will run the tests using `tap`.
## Run the server
`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`.
## Envs
|env|default|required|
|---|-------|--------|
|PORT|3000||
|NODE_ENV|local||
|BASIC_AUTH_USERNAME|dev||
|BASIC_AUTH_PASSWORD|dev||
|TMDB_API_KEY|INVALID_API_KEY|✅|
## TODOs
- [ ] 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](https://github.com/godaddy/out-of-band-cache/)).