Skip to content

Commit

Permalink
api endpoint environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
cobbinma committed Sep 24, 2023
1 parent 8b84155 commit 95d3386
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Tense, type QueryRootConjugatedVerbArgs } from '../../../../generated/graphql';
import { PUBLIC_API_ENDPOINT_URL } from '$env/static/public';
import axios from 'axios';

/** @type {import('./$types').PageServerLoad} */
Expand All @@ -11,7 +12,9 @@ export async function load({ params }) {
tense
};

const response = await axios.post('http://api.process.spanish.internal:8080/graphql', {
console.log(PUBLIC_API_ENDPOINT_URL);

const response = await axios.post(PUBLIC_API_ENDPOINT_URL, {
query: `
query GetVerb($infinitive: String!, $tense: Tense!) {
conjugatedVerb(infinitive: $infinitive, tense: $tense) {
Expand Down
3 changes: 3 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
app = "spanish"
primary_region = "lhr"

[env]
PUBLIC_API_ENDPOINT_URL = "http://api.process.spanish.internal:8080/graphql"

[processes]
api = "./app/api/conjugation-api"
ui = "node ./ui/build/"
Expand Down

0 comments on commit 95d3386

Please sign in to comment.