Unverified Commit 2e0f52ac authored by Joe McCann's avatar Joe McCann Committed by GitHub

upgrade from deprecated url.parse() since Node 11 (#11825)

Co-Authored-By: 's avatarTim Neutkens <tim@timneutkens.nl>
parent b516c4ea
const { createServer } = require('http') const { createServer } = require('http')
const { parse } = require('url')
const next = require('next') const next = require('next')
const port = parseInt(process.env.PORT, 10) || 3000 const port = parseInt(process.env.PORT, 10) || 3000
...@@ -9,7 +8,7 @@ const handle = app.getRequestHandler() ...@@ -9,7 +8,7 @@ const handle = app.getRequestHandler()
app.prepare().then(() => { app.prepare().then(() => {
createServer((req, res) => { createServer((req, res) => {
const parsedUrl = parse(req.url, true) const parsedUrl = new URL(req.url, 'http://w.w')
const { pathname, query } = parsedUrl const { pathname, query } = parsedUrl
if (pathname === '/a') { if (pathname === '/a') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment