mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 19:01:35 +01:00
Proxy API and webapp through NGINX as well
This commit is contained in:
@@ -4,7 +4,7 @@ export const load: PageServerLoad = async ({ parent, params, fetch, cookies }) =
|
||||
const { website, home } = await parent();
|
||||
|
||||
const collabData = await fetch(
|
||||
`http://localhost:${process.env.ARCHTIKA_API_PORT}/collab?website_id=eq.${params.websiteId}&select=*,user!user_id(*)`,
|
||||
`/api/collab?website_id=eq.${params.websiteId}&select=*,user!user_id(*)`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
@@ -27,7 +27,7 @@ export const actions: Actions = {
|
||||
addCollaborator: async ({ request, fetch, cookies, params }) => {
|
||||
const data = await request.formData();
|
||||
|
||||
const res = await fetch(`http://localhost:${process.env.ARCHTIKA_API_PORT}/collab`, {
|
||||
const res = await fetch(`/api/collab`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -51,7 +51,7 @@ export const actions: Actions = {
|
||||
const data = await request.formData();
|
||||
|
||||
const res = await fetch(
|
||||
`http://localhost:${process.env.ARCHTIKA_API_PORT}/collab?website_id=eq.${params.websiteId}&user_id=eq.${data.get("user-id")}`,
|
||||
`/api/collab?website_id=eq.${params.websiteId}&user_id=eq.${data.get("user-id")}`,
|
||||
{
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
@@ -75,7 +75,7 @@ export const actions: Actions = {
|
||||
const data = await request.formData();
|
||||
|
||||
const res = await fetch(
|
||||
`http://localhost:${process.env.ARCHTIKA_API_PORT}/collab?website_id=eq.${params.websiteId}&user_id=eq.${data.get("user-id")}`,
|
||||
`/api/collab?website_id=eq.${params.websiteId}&user_id=eq.${data.get("user-id")}`,
|
||||
{
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user