drop support for node < v10
Upgrade deps
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- 8
|
|
||||||
- 10
|
- 10
|
||||||
- 12
|
- 12
|
||||||
|
- 13
|
||||||
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2013-19
|
Copyright (c) 2013-20
|
||||||
Lloyd Brookes <75pound@gmail.com>
|
Lloyd Brookes <75pound@gmail.com>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
@ -120,4 +120,4 @@ $ npm install -g local-web-server
|
|||||||
|
|
||||||
* * *
|
* * *
|
||||||
|
|
||||||
© 2013-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).
|
© 2013-20 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
const nodeVersionMatches = require('node-version-matches')
|
const nodeVersionMatches = require('node-version-matches')
|
||||||
|
|
||||||
if (nodeVersionMatches('>=8')) {
|
if (nodeVersionMatches('>=10')) {
|
||||||
const WsCli = require('../lib/cli-app')
|
const WsCli = require('../lib/cli-app')
|
||||||
const cli = new WsCli()
|
const cli = new WsCli()
|
||||||
cli.start()
|
cli.start()
|
||||||
} else {
|
} else {
|
||||||
console.log('Sorry, this app requires node v8.0.0 or above. Please upgrade https://nodejs.org/en/')
|
console.log('Sorry, this app requires node v10.0.0 or above. Please upgrade https://nodejs.org/en/')
|
||||||
}
|
}
|
||||||
|
1973
package-lock.json
generated
1973
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
44
package.json
44
package.json
@ -27,7 +27,7 @@
|
|||||||
"full-stack"
|
"full-stack"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=10"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "test-runner test/*.js",
|
"test": "test-runner test/*.js",
|
||||||
@ -39,29 +39,29 @@
|
|||||||
"index.js"
|
"index.js"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lws": "^2.0.7",
|
"lws": "^3.0.0",
|
||||||
"lws-basic-auth": "^1.0.3",
|
"lws-basic-auth": "^2.0.0",
|
||||||
"lws-blacklist": "^2.0.2",
|
"lws-blacklist": "^3.0.0",
|
||||||
"lws-body-parser": "^1.0.2",
|
"lws-body-parser": "^2.0.0",
|
||||||
"lws-compress": "^1.0.2",
|
"lws-compress": "^2.0.0",
|
||||||
"lws-conditional-get": "^1.0.1",
|
"lws-conditional-get": "^2.0.0",
|
||||||
"lws-cors": "^2.0.1",
|
"lws-cors": "^3.0.0",
|
||||||
"lws-index": "^1.0.5",
|
"lws-index": "^2.0.0",
|
||||||
"lws-json": "^1.0.1",
|
"lws-json": "^2.0.0",
|
||||||
"lws-log": "^1.0.3",
|
"lws-log": "^2.0.0",
|
||||||
"lws-mime": "^1.0.1",
|
"lws-mime": "^2.0.0",
|
||||||
"lws-range": "^2.0.1",
|
"lws-range": "^3.0.0",
|
||||||
"lws-request-monitor": "^1.0.4",
|
"lws-request-monitor": "^2.0.0",
|
||||||
"lws-rewrite": "^2.0.10",
|
"lws-rewrite": "^3.0.0",
|
||||||
"lws-spa": "^2.0.2",
|
"lws-spa": "^3.0.0",
|
||||||
"lws-static": "^1.1.3",
|
"lws-static": "^2.0.0",
|
||||||
"node-version-matches": "^1.0.1"
|
"node-version-matches": "^2.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"coveralls": "^3.0.7",
|
"coveralls": "^3.0.9",
|
||||||
"jsdoc-to-markdown": "^5.0.2",
|
"jsdoc-to-markdown": "^5.0.3",
|
||||||
"node-fetch": "^2.6.0",
|
"node-fetch": "^2.6.0",
|
||||||
"nyc": "^14.1.1",
|
"nyc": "^15.0.0",
|
||||||
"test-runner": "^0.7.2"
|
"test-runner": "^0.8.13"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
const Tom = require('test-runner').Tom
|
const Tom = require('test-runner').Tom
|
||||||
const fetch = require('node-fetch')
|
const fetch = require('node-fetch')
|
||||||
const LocalWebServer = require('../')
|
const LocalWebServer = require('../')
|
||||||
const a = require('assert')
|
const a = require('assert').strict
|
||||||
|
|
||||||
const tom = module.exports = new Tom()
|
const tom = module.exports = new Tom()
|
||||||
|
|
||||||
@ -14,5 +14,5 @@ tom.test('basic', async function () {
|
|||||||
const response = await fetch(`http://localhost:${port}/one.txt`)
|
const response = await fetch(`http://localhost:${port}/one.txt`)
|
||||||
ws.server.close()
|
ws.server.close()
|
||||||
const body = await response.text()
|
const body = await response.text()
|
||||||
a.strictEqual(body, 'one\n')
|
a.equal(body, 'one\n')
|
||||||
})
|
})
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const Tom = require('test-runner').Tom
|
const Tom = require('test-runner').Tom
|
||||||
const a = require('assert')
|
const a = require('assert').strict
|
||||||
const WsCli = require('../lib/cli-app')
|
const WsCli = require('../lib/cli-app')
|
||||||
const fetch = require('node-fetch')
|
const fetch = require('node-fetch')
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ tom.test('simple', async function () {
|
|||||||
const server = cli.start([ '--port', `${port}` ])
|
const server = cli.start([ '--port', `${port}` ])
|
||||||
const response = await fetch(`http://127.0.0.1:${port}/package.json`)
|
const response = await fetch(`http://127.0.0.1:${port}/package.json`)
|
||||||
server.close()
|
server.close()
|
||||||
a.strictEqual(response.status, 200)
|
a.equal(response.status, 200)
|
||||||
})
|
})
|
||||||
|
|
||||||
tom.test('bad option', async function () {
|
tom.test('bad option', async function () {
|
||||||
@ -19,7 +19,7 @@ tom.test('bad option', async function () {
|
|||||||
const cli = new WsCli({ logError: function () {} })
|
const cli = new WsCli({ logError: function () {} })
|
||||||
const server = cli.start([ '--should-fail' ])
|
const server = cli.start([ '--should-fail' ])
|
||||||
if (!exitCode) process.exitCode = 0
|
if (!exitCode) process.exitCode = 0
|
||||||
a.strictEqual(server, undefined)
|
a.equal(server, undefined)
|
||||||
})
|
})
|
||||||
|
|
||||||
tom.test('--help', async function () {
|
tom.test('--help', async function () {
|
||||||
@ -32,7 +32,7 @@ tom.test('--version', async function () {
|
|||||||
const cli = new WsCli({ log: function (msg) { logMsg = msg } })
|
const cli = new WsCli({ log: function (msg) { logMsg = msg } })
|
||||||
cli.start([ '--version' ])
|
cli.start([ '--version' ])
|
||||||
const pkg = require('../package.json')
|
const pkg = require('../package.json')
|
||||||
a.strictEqual(logMsg.trim(), pkg.version)
|
a.equal(logMsg.trim(), pkg.version)
|
||||||
})
|
})
|
||||||
|
|
||||||
tom.test('default-stack', async function () {
|
tom.test('default-stack', async function () {
|
||||||
|
Reference in New Issue
Block a user