Files
vue-cli/packages/@vue/cli-test-utils/createServer.js
Haoqun Jiang 3648a51a91 test: replace http-server with serve to create a test server (#4056)
Fixes Windows compatibility caused by https://github.com/indexzero/http-server/issues/525

And, serve is better maintained than http-server or ecstatic.
2019-05-25 13:32:32 +08:00

13 lines
280 B
JavaScript

const handler = require('serve-handler')
const http = require('http')
module.exports = function createServer (options) {
const server = http.createServer((request, response) => {
return handler(request, response, {
public: options.root
})
})
return server
}