From c21fc517cc4e390a8d06d9dd6ea48aecdaf284f8 Mon Sep 17 00:00:00 2001 From: andrzej Date: Sun, 26 May 2024 16:39:38 +0200 Subject: [PATCH] use env variables instead of json --- package.json | 2 +- src/objects/tmdb.tsx | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c54994f..493888f 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/src/objects/tmdb.tsx b/src/objects/tmdb.tsx index ffee17c..9a22845 100644 --- a/src/objects/tmdb.tsx +++ b/src/objects/tmdb.tsx @@ -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.local.VITE_TOKEN, 'Content-Type': 'application/json', } })