Skip to content

Commit

Permalink
Remove environmental variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Loudbooks committed Dec 3, 2024
1 parent 109a560 commit 5391a2f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 154 deletions.
4 changes: 0 additions & 4 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ FROM node:23-alpine AS build

WORKDIR /pastebook-frontend

ARG VITE_API_URL

ENV VITE_API_URL=${VITE_API_URL}

COPY package*.json ./
RUN npm install
COPY . .
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/new/Submit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import { writableContent } from "$lib/stores.ts";
import { onMount } from "svelte";
const backendUrl = import.meta.env.VITE_API_URL;
onMount(() => {
writableTitle.subscribe(() => {
allFieldsFilled();
Expand Down Expand Up @@ -50,9 +48,11 @@
console.log(backendUrl)
alreadyUploading = true;
submit.classList.add("loading");
const xhr = new XMLHttpRequest();
xhr.open("POST", `${backendUrl}/upload`);
let domain = window.location.host;
xhr.open("POST", `https://api.${domain}/upload`);
xhr.setRequestHeader("Content-Type", "plain/text");
xhr.setRequestHeader("access-control-allow-methods", "POST");
xhr.setRequestHeader("title", $writableTitle);
Expand Down
146 changes: 0 additions & 146 deletions frontend/src/components/panel/ListedPaste.svelte

This file was deleted.

0 comments on commit 5391a2f

Please sign in to comment.