From 0cfadf91a8ac1047afb8324bb8b1f7f2b400abe5 Mon Sep 17 00:00:00 2001 From: Eddie Wang Date: Tue, 3 Dec 2019 16:45:38 -0500 Subject: [PATCH] rewrite nginx path --- package.json | 2 +- packages/siaviewnode-client/src/components/Dropzone.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index eb0aecfa..f0749443 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "scripts": { "client-dev": "yarn workspace siaviewnode-client dev -p 3000", "server-dev": "yarn workspace siaviewnode-server dev", - "client-prod": "yarn workspace siaviewnode-client start -p 3000", + "client-prod": "yarn workspace siaviewnode-client build && yarn workspace siaviewnode-client start -p 3000", "server-prod": "yarn workspace siaviewnode-server build && yarn workspace siaviewnode-server start", "dev": "concurrently \"yarn client-dev\" \"yarn server-dev\"", "start": "concurrently \"yarn client-prod\" \"yarn server-prod\"" diff --git a/packages/siaviewnode-client/src/components/Dropzone.tsx b/packages/siaviewnode-client/src/components/Dropzone.tsx index 00bec0d9..27765b9b 100644 --- a/packages/siaviewnode-client/src/components/Dropzone.tsx +++ b/packages/siaviewnode-client/src/components/Dropzone.tsx @@ -4,7 +4,10 @@ import { useCallback } from "react" import { useDropzone } from "react-dropzone" import { Box, Flex, jsx } from "theme-ui" -const API_ENDPOINT = "http://144.76.136.122/api" +/** + * nginx is setup to automatically handle and rewrite the url path. + */ +const API_ENDPOINT = "/api" const pName = R.prop("name")