use env variables instead of json
Gitea/movie-explorer/pipeline/head This commit looks good Details

This commit is contained in:
andrzej 2024-05-26 16:39:38 +02:00
parent 90c4db1431
commit 70819af784
3 changed files with 3 additions and 4 deletions

2
.gitignore vendored
View File

@ -23,4 +23,4 @@ dist-ssr
*.sln
*.sw?
src/conf.js
src/auth.json
.env

View File

@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && touch src/auth.json && vite build --base=/movie-explorer/",
"build": "tsc && vite build --base=/movie-explorer/",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},

View File

@ -1,12 +1,11 @@
import axios from 'axios'
import * as auth from '../auth.json';
import { Movie } from './movie-wall';
import { Config } from '../App';
const tmdb = axios.create({
baseURL: `https://api.themoviedb.org/3/movie`,
headers: {
Authorization: 'Bearer ' + auth.token,
Authorization: 'Bearer ' + import.meta.env.VITE_TOKEN,
'Content-Type': 'application/json',
}
})