diff --git a/examples/with-zones/.babelrc b/examples/with-zones/.babelrc new file mode 100644 index 0000000000000..1e671b68f76b8 --- /dev/null +++ b/examples/with-zones/.babelrc @@ -0,0 +1,4 @@ +{ + "presets": ["next/babel"], + "plugins": [] + } diff --git a/examples/with-zones/account/.gitignore b/examples/with-zones/account/.gitignore new file mode 100644 index 0000000000000..f74c78183c917 --- /dev/null +++ b/examples/with-zones/account/.gitignore @@ -0,0 +1,2 @@ +.next +node_modules diff --git a/examples/with-zones/account/next.config.js b/examples/with-zones/account/next.config.js new file mode 100644 index 0000000000000..ef67911713fe6 --- /dev/null +++ b/examples/with-zones/account/next.config.js @@ -0,0 +1,6 @@ +const { NOW_URL } = process.env +const { alias } = require('./now.json') + +module.exports = { + assetPrefix: NOW_URL ? `https://${alias}` : 'http://localhost:3000' +} diff --git a/examples/with-zones/account/now.json b/examples/with-zones/account/now.json new file mode 100644 index 0000000000000..3c3113c5bada7 --- /dev/null +++ b/examples/with-zones/account/now.json @@ -0,0 +1,3 @@ +{ + "alias": "with-zones-account.now.sh" +} diff --git a/examples/with-zones/account/package.json b/examples/with-zones/account/package.json new file mode 100644 index 0000000000000..e6f706850c596 --- /dev/null +++ b/examples/with-zones/account/package.json @@ -0,0 +1,14 @@ +{ + "name": "with-zones-account", + "version": "1.0.0", + "scripts": { + "build": "next build", + "start": "next start -p 3000" + }, + "dependencies": { + "next": "latest", + "react": "^16.0.0", + "react-dom": "^16.0.0" + }, + "license": "ISC" +} diff --git a/examples/with-zones/account/pages/account.js b/examples/with-zones/account/pages/account.js new file mode 100644 index 0000000000000..b77deab8ee845 --- /dev/null +++ b/examples/with-zones/account/pages/account.js @@ -0,0 +1,5 @@ +export default () => ( +
This is our homepage
+ ) diff --git a/examples/with-zones/package.json b/examples/with-zones/package.json index a24bbcea0807b..09e105232c453 100644 --- a/examples/with-zones/package.json +++ b/examples/with-zones/package.json @@ -8,6 +8,9 @@ "blog": "next blog -p 5000", "blog-build": "next build blog", "blog-start": "next start blog -p 5000", + "account": "next account -p 3000", + "account-build": "next build account", + "account-start": "next start account -p 3000", "proxy": "micro-proxy -r rules-dev.json" }, "dependencies": { diff --git a/examples/with-zones/rules-dev.json b/examples/with-zones/rules-dev.json index 680a330286beb..1a9734b2bf3ac 100644 --- a/examples/with-zones/rules-dev.json +++ b/examples/with-zones/rules-dev.json @@ -1,6 +1,7 @@ { "rules": [ {"pathname": "/blog", "method":["GET", "POST", "OPTIONS"], "dest": "http://localhost:5000"}, + {"pathname": "/account", "dest": "http://localhost:3000"}, {"pathname": "/**", "dest": "http://localhost:4000"} ] }