From 1c6f8895e74abab22529ecc461e74dafac6d55b4 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Sat, 20 Feb 2021 16:44:12 +0100 Subject: [PATCH] move build to cmd --- packages/dashboard/.env | 1 + packages/dashboard/.gitignore | 3 +++ packages/dashboard/src/pages/downloads.js | 2 +- packages/dashboard/src/pages/index.js | 2 +- packages/dashboard/src/pages/uploads.js | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 packages/dashboard/.env diff --git a/packages/dashboard/.env b/packages/dashboard/.env new file mode 100644 index 00000000..3b030c27 --- /dev/null +++ b/packages/dashboard/.env @@ -0,0 +1 @@ +SKYNET_PORTAL_API=https://siasky.net diff --git a/packages/dashboard/.gitignore b/packages/dashboard/.gitignore index 173ca174..ea47d16a 100644 --- a/packages/dashboard/.gitignore +++ b/packages/dashboard/.gitignore @@ -24,6 +24,9 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +# env defaults +!.env + # local env files .env.local .env.development.local diff --git a/packages/dashboard/src/pages/downloads.js b/packages/dashboard/src/pages/downloads.js index 256ef215..763c6726 100644 --- a/packages/dashboard/src/pages/downloads.js +++ b/packages/dashboard/src/pages/downloads.js @@ -7,7 +7,7 @@ import Table from "../components/Table"; import authServerSideProps from "../services/authServerSideProps"; import { SkynetClient } from "skynet-js"; -const skynetClient = new SkynetClient(process.env.SKYNET_PORTAL_API ?? "https://siasky.net"); +const skynetClient = new SkynetClient(process.env.SKYNET_PORTAL_API); const apiPrefix = process.env.NODE_ENV === "development" ? "/api/stubs" : ""; const fetcher = (url) => fetch(url).then((r) => r.json()); const getSkylinkLink = ({ skylink }) => skynetClient.getSkylinkUrl(skylink); diff --git a/packages/dashboard/src/pages/index.js b/packages/dashboard/src/pages/index.js index bc2ecef6..c8124e4d 100644 --- a/packages/dashboard/src/pages/index.js +++ b/packages/dashboard/src/pages/index.js @@ -9,7 +9,7 @@ import { SkynetClient } from "skynet-js"; dayjs.extend(relativeTime); -const skynetClient = new SkynetClient(process.env.SKYNET_PORTAL_API ?? "https://siasky.net"); +const skynetClient = new SkynetClient(process.env.SKYNET_PORTAL_API); const apiPrefix = process.env.NODE_ENV === "development" ? "/api/stubs" : ""; const fetcher = (url) => fetch(url).then((r) => r.json()); diff --git a/packages/dashboard/src/pages/uploads.js b/packages/dashboard/src/pages/uploads.js index 125f2f69..6bcf7a45 100644 --- a/packages/dashboard/src/pages/uploads.js +++ b/packages/dashboard/src/pages/uploads.js @@ -7,7 +7,7 @@ import Table from "../components/Table"; import authServerSideProps from "../services/authServerSideProps"; import { SkynetClient } from "skynet-js"; -const skynetClient = new SkynetClient(process.env.SKYNET_PORTAL_API ?? "https://siasky.net"); +const skynetClient = new SkynetClient(process.env.SKYNET_PORTAL_API); const apiPrefix = process.env.NODE_ENV === "development" ? "/api/stubs" : ""; const fetcher = (url) => fetch(url).then((r) => r.json()); const getSkylinkLink = ({ skylink }) => skynetClient.getSkylinkUrl(skylink);