Skip to content

Commit

Permalink
feat: support nextjs v12
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill K committed Mar 10, 2022
1 parent b838c29 commit 140b51c
Show file tree
Hide file tree
Showing 4 changed files with 417 additions and 3,362 deletions.
10 changes: 9 additions & 1 deletion bin/next-remote-watch
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,16 @@ program
.parse(process.argv)

const shell = process.env.SHELL
const app = next({ dev: true, dir: program.root || process.cwd() })
const port = parseInt(process.env.PORT, 10) || 3000
const hostname = process.env.HOSTNAME || 'localhost'
const app = next({
dev: true,
dir: program.root || process.cwd(),
// When using middlewares in NextJS 12, `hostname` and `port` must be provided
// (https://nextjs.org/docs/advanced-features/custom-server)
port,
hostname,
})
const handle = app.getRequestHandler()

app.prepare().then(() => {
Expand Down
Loading

0 comments on commit 140b51c

Please sign in to comment.