1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Only show the URL locally, not on the Now platform

Now outputs a URL by itself
This commit is contained in:
Leo Lamprecht 2016-12-06 21:39:26 +01:00
parent 7086287eaf
commit 7bb903d563
No known key found for this signature in database
GPG key ID: B08517883D5E0E10
2 changed files with 7 additions and 2 deletions

View file

@ -23,7 +23,10 @@ clean(dir)
.then(async () => { .then(async () => {
const srv = new Server({ dir, dev: true, hotReload: true }) const srv = new Server({ dir, dev: true, hotReload: true })
await srv.start(argv.port) await srv.start(argv.port)
console.log(`> Ready on http://localhost:${argv.port}`)
if (!process.env.NOW) {
console.log(`> Ready on http://localhost:${argv.port}`)
}
// Check if pages dir exists and warn if not // Check if pages dir exists and warn if not
if (!(await exists(join(dir, 'pages')))) { if (!(await exists(join(dir, 'pages')))) {

View file

@ -20,7 +20,9 @@ const dir = resolve(argv._[0] || '.')
const srv = new Server({ dir }) const srv = new Server({ dir })
srv.start(argv.port) srv.start(argv.port)
.then(() => { .then(() => {
console.log(`> Ready on http://localhost:${argv.port}`) if (!process.env.NOW) {
console.log(`> Ready on http://localhost:${argv.port}`)
}
}) })
.catch((err) => { .catch((err) => {
console.error(err) console.error(err)