Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add support for basepath #4990

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions examples/with-zones/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["next/babel"],
"plugins": []
}
2 changes: 2 additions & 0 deletions examples/with-zones/account/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.next
node_modules
6 changes: 6 additions & 0 deletions examples/with-zones/account/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const { NOW_URL } = process.env
const { alias } = require('./now.json')

module.exports = {
assetPrefix: NOW_URL ? `https://${alias}` : 'http://localhost:3000'
}
3 changes: 3 additions & 0 deletions examples/with-zones/account/now.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"alias": "with-zones-account.now.sh"
}
14 changes: 14 additions & 0 deletions examples/with-zones/account/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
5 changes: 5 additions & 0 deletions examples/with-zones/account/pages/account.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default () => (
<div>
This is your account
</div>
)
1 change: 1 addition & 0 deletions examples/with-zones/home/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default () => (
<p>This is our homepage</p>
<div><Link href='/blog'><a>Blog</a></Link></div>
<div><Link href='/about'><a>About us</a></Link></div>
<div><Link href='/account'><a>Account</a></Link></div>
<img width={200} src={asset('/nextjs.png')} />
</div>
)
3 changes: 3 additions & 0 deletions examples/with-zones/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions examples/with-zones/rules-dev.json
Original file line number Diff line number Diff line change
@@ -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"}
]
}