mirror of
https://github.com/KevinMidboe/brewPi.git
synced 2025-10-29 08:40:13 +00:00
Added brewlogger/brewpi host as env variable
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
ES_CLIENT=http://localhost:3200
|
||||
ES_HOST=http://localhost:3200
|
||||
ES_INDEX=brewlogger-*
|
||||
ES_APIKEY=
|
||||
|
||||
BREWLOGGER_HOST=http://127.0.0.1:5000
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { env } from '$env/dynamic/private';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
const host = 'http://brewpi.schleppe:5000';
|
||||
const host = env.BREWLOGGER_HOST;
|
||||
const sensorsUrl = `${host}/api/sensors`;
|
||||
const relaysUrl = `${host}/api/relays`;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { json } from '@sveltejs/kit';
|
||||
import { json, RequestEvent } from '@sveltejs/kit';
|
||||
import { env } from '$env/dynamic/private';
|
||||
import type { RequestHandler } from './$types';
|
||||
|
||||
// const BREWPI_URL = ''
|
||||
const BREWPI_URL = 'http://brewpi.schleppe:5000';
|
||||
const BREWPI_URL = env.BREWLOGGER_HOST;
|
||||
|
||||
export const POST = (async ({ request }) => {
|
||||
const { pathname } = new URL(request.url);
|
||||
export const POST = (async (event: RequestEvent) => {
|
||||
const { pathname } = new URL(event.request.url);
|
||||
|
||||
const options = { method: 'POST' };
|
||||
return fetch(BREWPI_URL + pathname, options)
|
||||
|
||||
Reference in New Issue
Block a user