File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 11import { AppProps } from "$fresh/server.ts" ;
22import Footer from "islands/footer.jsx" ;
3+ import "https://deno.land/x/dotenv/load.ts" ;
34
45const isDenoDeploy = Deno . env . get ( "DENO_DEPLOYMENT_ID" ) !== undefined ;
56
@@ -10,6 +11,14 @@ export default function App({ Component }: AppProps) {
1011 < meta charSet = "utf-8" />
1112 < meta name = "viewport" content = "width=device-width, initial-scale=1.0" />
1213 < title > Smiles Search</ title >
14+
15+ < script
16+ dangerouslySetInnerHTML = { {
17+ __html : `window.SMILES_SEARCH_URL = "${
18+ Deno . env . get ( "SMILES_SEARCH_URL" )
19+ } "; window.SMILES_TAX_URL = "${ Deno . env . get ( "SMILES_TAX_URL" ) } ";`,
20+ } }
21+ />
1322 { /* posthog */ }
1423 { isDenoDeploy
1524 ? (
Original file line number Diff line number Diff line change @@ -70,9 +70,9 @@ async function getTax({ flightUid, fare }) {
7070 } ) ;
7171
7272 const response = await fetch (
73- Deno . env . get ( " SMILES_TAX_URL" ) +
74- "?" +
75- params . toString ( ) ,
73+ window . SMILES_TAX_URL +
74+ "?" +
75+ params . toString ( ) ,
7676 {
7777 headers,
7878 } ,
@@ -86,8 +86,8 @@ async function searchFlights(paramsObject) {
8686 abortControllersSignal . value = [ ...abortControllersSignal . value , controller ] ;
8787 const params = new URLSearchParams ( { ...defaultParams , ...paramsObject } ) ;
8888 const response = await fetch (
89- Deno . env . get ( " SMILES_SEARCH_URL" ) + "?" +
90- params . toString ( ) ,
89+ window . SMILES_SEARCH_URL + "?" +
90+ params . toString ( ) ,
9191 {
9292 signal : controller . signal ,
9393 headers,
You can’t perform that action at this time.
0 commit comments