From 3a8f82bbce2c7db6fc7873a39c31eb1afd0060c7 Mon Sep 17 00:00:00 2001 From: Troy Goode Date: Mon, 27 May 2019 23:12:02 -0700 Subject: [PATCH] wiring up Netlify --- .gitignore | 1 + README.md | 2 ++ components/example.js | 2 +- package-lock.json | 5 +++++ package.json | 4 +++- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2d93931..d3c62f8 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ node_modules .next .webpack +out/ diff --git a/README.md b/README.md index d36200f..2da7329 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ A test application that helps illustrate CORS while both in a working state and a non-working state across simple and complex request scenarios. +[![node-cors-client](https://api.netlify.com/api/v1/badges/a374a315-b8e8-4554-9146-10fd6ffbbfc8/deploy-status)](https://app.netlify.com/sites/tender-ride-ab7fbe/deploys) + ## See Also * https://node-cors-client.herokuapp.com/ diff --git a/components/example.js b/components/example.js index f5428d0..8ed9a6b 100644 --- a/components/example.js +++ b/components/example.js @@ -1,7 +1,7 @@ import { useState } from "react"; import fetch from "isomorphic-unfetch"; -const baseUrl = "http://localhost:3001" || process.env.BASE_URL; +const baseUrl = "http://localhost:3001" || process.env.NEXT_STATIC_BASE_URL; const styles = { idle: { diff --git a/package-lock.json b/package-lock.json index 7295b37..241e5a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3549,6 +3549,11 @@ "worker-farm": "1.5.2" } }, + "next-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-env/-/next-env-1.1.0.tgz", + "integrity": "sha512-eSmpCrYzFqjN9en98jEvhz5Bzw5Ui4h8lV/Kua2zOFlD1NU+MG91u90M1WA6+mUnQROYy2Xv0FvVKNbZpeN8Ew==" + }, "next-server": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/next-server/-/next-server-8.1.0.tgz", diff --git a/package.json b/package.json index b2cc4bf..d4948dd 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,9 @@ "private": true, "scripts": { "dev": "next", - "build": "next build", "start": "next start", + "build": "next build", + "export": "npm run build && next export", "prettier": "prettier --write {components,pages}/**/*.js" }, "engines": { @@ -15,6 +16,7 @@ "dependencies": { "isomorphic-unfetch": "^3.0.0", "next": "^8.1.0", + "next-env": "^1.1.0", "react": "^16.8.6", "react-dom": "^16.8.6" },