From 9547e77820305ac90a60d652f09ab29af53e11d3 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 19 Nov 2018 16:36:18 +0100 Subject: [PATCH] use native http instead of micro (#5706) --- package.json | 1 - packages/next/README.md | 4 ++-- test/integration/custom-server/server.js | 4 ++-- test/integration/filesystempublicroutes/server.js | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index e8bfca80..dc9102f1 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,6 @@ "jest-cli": "23.6.0", "lerna": "^3.4.0", "lint-staged": "4.2.3", - "micro": "9.1.0", "mkdirp": "0.5.1", "node-fetch": "1.7.3", "node-notifier": "5.1.2", diff --git a/packages/next/README.md b/packages/next/README.md index 4cff26d6..131dfd37 100644 --- a/packages/next/README.md +++ b/packages/next/README.md @@ -899,14 +899,14 @@ Here's an example usage of it: ```js const next = require('next') -const micro = require('micro') +const http = require('http') const dev = process.env.NODE_ENV !== 'production' const app = next({ dev }) const handleNextRequests = app.getRequestHandler() app.prepare().then(() => { - const server = micro((req, res) => { + const server = new http.Server((req, res) => { // Add assetPrefix support based on the hostname if (req.headers.host === 'my-app.com') { app.setAssetPrefix('http://cdn.com/myapp') diff --git a/test/integration/custom-server/server.js b/test/integration/custom-server/server.js index 447cc4d0..71b62d95 100644 --- a/test/integration/custom-server/server.js +++ b/test/integration/custom-server/server.js @@ -1,4 +1,4 @@ -const micro = require('micro') +const http = require('http') const next = require('next') const dev = process.env.NODE_ENV !== 'production' @@ -9,7 +9,7 @@ const app = next({ dev, dir }) const handleNextRequests = app.getRequestHandler() app.prepare().then(() => { - const server = micro((req, res) => { + const server = new http.Server((req, res) => { if (/setAssetPrefix/.test(req.url)) { app.setAssetPrefix(`http://127.0.0.1:${port}`) } else if (/setEmptyAssetPrefix/.test(req.url)) { diff --git a/test/integration/filesystempublicroutes/server.js b/test/integration/filesystempublicroutes/server.js index 447cc4d0..71b62d95 100644 --- a/test/integration/filesystempublicroutes/server.js +++ b/test/integration/filesystempublicroutes/server.js @@ -1,4 +1,4 @@ -const micro = require('micro') +const http = require('http') const next = require('next') const dev = process.env.NODE_ENV !== 'production' @@ -9,7 +9,7 @@ const app = next({ dev, dir }) const handleNextRequests = app.getRequestHandler() app.prepare().then(() => { - const server = micro((req, res) => { + const server = new http.Server((req, res) => { if (/setAssetPrefix/.test(req.url)) { app.setAssetPrefix(`http://127.0.0.1:${port}`) } else if (/setEmptyAssetPrefix/.test(req.url)) {