Skip to content

Commit

Permalink
Revert "Feat/env variables" (#307)
Browse files Browse the repository at this point in the history
* Revert "Feat/env variables (#183)"

This reverts commit 90d9c02.

* chore: revert env variables
  • Loading branch information
vvatelot authored Jan 8, 2024
1 parent 90d9c02 commit 23d71c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
10 changes: 3 additions & 7 deletions assets/js/services/ApiService.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import ky from "ky";
import params from "@params";

class ApiService {
#controller = null;

// Params imported from Hugo config params
// (they can be defined through environment variables)
#apiKey = params.api.key;
#baseURL = params.api.baseurl;
#host = params.api.host;
#baseURL = "https://api.ecoindex.fr/v1/";
#browserWidth = 1920;
#browserHeight = 1080;

Expand Down Expand Up @@ -87,7 +81,9 @@ class ApiService {
async #fetchApi(slug, options) {
this.abortAnalysis();
const controller = (this.#controller = new AbortController());

const { signal } = controller;

const response = await ky(slug, {
...options,
prefixUrl: this.#baseURL,
Expand Down
5 changes: 0 additions & 5 deletions config/_default/params.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
themeColor = "#007e5f"

[api]
key = "3037e7e96fmsh12bedced9f019f8p1cd804jsn4967070f8bda"
baseurl = "https://ecoindex.p.rapidapi.com/v1/"
host = "ecoindex.p.rapidapi.com"

0 comments on commit 23d71c1

Please sign in to comment.