Skip to content

Commit

Permalink
Merge pull request #5 from lightning-js/fix/tmdb-app
Browse files Browse the repository at this point in the history
TMDB API related changes
  • Loading branch information
michielvandergeest authored Nov 13, 2023
2 parents 9220191 + bdaa2d4 commit 6c6fa0e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 33 deletions.
1 change: 1 addition & 0 deletions .example.env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
VITE_TMDB_KEY=ABC123
VITE_TMDB_BASE_URL=https://8b4fa39d.lightningjs.workers.dev
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
- name: Install dependencies
run: npm install

- name: Create .env file
run: cp .env.example .env

- name: Build
run: npm run build

Expand Down
31 changes: 2 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,9 @@ Clone this repository and run `npm install` in the project root.

Then run `npm run dev` to start the dev server and open the URL printed in your terminal to check the App.

This Blits L3 Example App contains a demo of a TMBD integration. Head over to https://developers.themoviedb.org/3/getting-started/introduction to get your own TMDB API key and paste it inside a `.env` file (follwing the example in `.example.env`)

## App Usage


Once you've directed your browser to the URL displayed in your terminal, you have the option to navigate through the various examples using the `arrow keys` or directly access a specific example. Assuming it's running at `http://localhost:5173/`: here are the direct links to each example:

- Loading http://localhost:5173/
- Splash screen: http://localhost:5173/#/intro
- Positioning: http://localhost:5173/#/positioning
- Transitions: http://localhost:5173/#/transitions
- Gradients: http://localhost:5173/#/gradients
- Components: http://localhost:5173/#/components
- Keyinput handling: http://localhost:5173/#/keyinput
- Coloring: http://localhost:5173/#/colors
- For loop implementation: http://localhost:5173/#/forloop
- Apply scaling: http://localhost:5173/#/scaling
- Different effects: http://localhost:5173/#/effects
- Alpha: http://localhost:5173/#/alpha
- Conditional rendering: http://localhost:5173/#/showif
- Images: http://localhost:5173/#/images
- Rotation: http://localhost:5173/#/rotation
- Events: http://localhost:5173/#/events
- Focus handling: http://localhost:5173/#/focushandling
- Rendering spritemaps: http://localhost:5173/#/sprites
- Text: http://localhost:5173/#/texts
- Apply theming: http://localhost:5173/#/theming
- TMDB example app ( key requiredm as described above ): http://localhost:5173/#/theming

This Blits L3 Example App contains a demo of a TMBD integration. Head over to https://developers.themoviedb.org/3/getting-started/introduction to get your own TMDB API key and paste it inside a `.env` file (following the example in `.example.env`). To use your own TMDB API key, you also need to change `VITE_TMDB_BASE_URL` in your `.env` file to `https://api.themoviedb.org/3`.

You can also take a look at the [hosted version](http://blits-demo.lightningjs.io) of this App.

## Bugs or issues?

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lightningjs/blits-example-app",
"version": "0.3.1",
"version": "0.3.2",
"description": "Lightning 3 Blits Example App",
"main": "index.js",
"type": "module",
Expand Down
3 changes: 2 additions & 1 deletion src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/

const API_KEY_V4 = import.meta.env.VITE_TMDB_KEY
const API_BASE = 'https://api.themoviedb.org/3'
const API_BASE = import.meta.env.VITE_TMDB_BASE_URL

let tmdbConfig
let baseImageUrl
const basePosterSize = 'w185'
Expand Down

0 comments on commit 6c6fa0e

Please sign in to comment.