Skip to content

Commit 7ad2f11

Browse files
committedMay 23, 2019
update dates, deps and travis
1 parent cd9d5ed commit 7ad2f11

9 files changed

+497
-739
lines changed
 

‎.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
language: node_js
22
node_js:
3-
- 7
43
- 8
54
- 10
6-
- 11
5+
- 12

‎LICENSE

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013-18 Lloyd Brookes <75pound@gmail.com>
3+
Copyright (c) 2013-19
4+
Lloyd Brookes <75pound@gmail.com>
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

‎README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[![npm (tag)](https://img.shields.io/npm/v/local-web-server.svg)](https://www.npmjs.org/package/local-web-server)
1+
[![view on npm](https://img.shields.io/npm/v/local-web-server.svg)](https://www.npmjs.org/package/local-web-server)
22
[![npm module downloads](https://img.shields.io/npm/dt/local-web-server.svg)](https://www.npmjs.org/package/local-web-server)
33
[![Build Status](https://travis-ci.org/lwsjs/local-web-server.svg?branch=master)](https://travis-ci.org/lwsjs/local-web-server)
44
[![Coverage Status](https://coveralls.io/repos/github/lwsjs/local-web-server/badge.svg?branch=master)](https://coveralls.io/github/lwsjs/local-web-server?branch=master)
5-
[![dependencies Status](https://david-dm.org/lwsjs/local-web-server/master/status.svg)](https://david-dm.org/lwsjs/local-web-server/master)
5+
[![Dependency Status](https://badgen.net/david/dep/lwsjs/local-web-server)](https://david-dm.org/lwsjs/local-web-server)
66
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)
77
[![Join the chat at https://gitter.im/lwsjs/local-web-server](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/lwsjs/local-web-server?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
88

9-
**Requires node v7.6 or above. Upgraders, please read the [release notes](https://github.com/lwsjs/local-web-server/releases)**.
9+
**Requires node v8 or above. Upgraders, please read the [release notes](https://github.com/lwsjs/local-web-server/releases)**.
1010

1111
# local-web-server
1212

@@ -155,11 +155,12 @@ See [the tutorials](https://github.com/lwsjs/local-web-server/wiki#tutorials) fo
155155

156156
## Install
157157

158-
**Requires node v7.6 or above**. Install the [previous release](https://github.com/lwsjs/local-web-server/tree/v1.x) for node >= v4.0.0.
158+
**Requires node v8 or above**. Install the [previous release](https://github.com/lwsjs/local-web-server/tree/v1.x) for node >= v4.0.0.
159159

160160
```sh
161161
$ npm install -g local-web-server
162162
```
163163
* * *
164164

165-
&copy; 2013-18 Lloyd Brookes <75pound@gmail.com>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).
165+
&copy; 2013-19
166+
Lloyd Brookes <75pound@gmail.com>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).

‎bin/cli.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env node
22
const nodeVersionMatches = require('node-version-matches')
33

4-
if (nodeVersionMatches('>=7.6.0')) {
4+
if (nodeVersionMatches('>=8.0.0')) {
55
require('../lib/cli-app').run()
66
} else {
7-
console.log('Sorry, this app requires node v7.6.0 or above. Please upgrade https://nodejs.org/en/')
7+
console.log('Sorry, this app requires node v8.0.0 or above. Please upgrade https://nodejs.org/en/')
88
}

‎lib/default-stack.js

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module.exports = [
1111
'lws-conditional-get',
1212
'lws-mime',
1313
'lws-range',
14-
'lws-mock-response',
1514
'lws-spa',
1615
'lws-static',
1716
'lws-index'

‎package-lock.json

+457-699
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+12-13
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
"proxy"
2222
],
2323
"engines": {
24-
"node": ">=7.6"
24+
"node": ">=8"
2525
},
2626
"scripts": {
2727
"test": "test-runner test/*.js",
2828
"docs": "jsdoc2md -p list index.js lib/*.js > doc/api.md; echo",
29-
"cover": "nyc --reporter=text-lcov test-runner test/*.js | coveralls"
29+
"cover": "nyc npm test && nyc report --reporter=text-lcov | coveralls"
3030
},
3131
"repository": "https://github.com/lwsjs/local-web-server",
3232
"author": "Lloyd Brookes <75pound@gmail.com>",
@@ -36,9 +36,9 @@
3636
"index.js"
3737
],
3838
"dependencies": {
39-
"lws": "^1.3.0",
39+
"lws": "^1.3.2",
4040
"lws-basic-auth": "^0.1.1",
41-
"lws-blacklist": "^0.3.0",
41+
"lws-blacklist": "^1.0.0",
4242
"lws-body-parser": "^0.2.4",
4343
"lws-compress": "^0.2.1",
4444
"lws-conditional-get": "^0.3.4",
@@ -47,18 +47,17 @@
4747
"lws-json": "^0.3.2",
4848
"lws-log": "^0.3.2",
4949
"lws-mime": "^0.2.2",
50-
"lws-mock-response": "^0.5.1",
51-
"lws-range": "^1.1.0",
50+
"lws-range": "^1.1.1",
5251
"lws-request-monitor": "^0.1.5",
53-
"lws-rewrite": "^0.4.1",
54-
"lws-spa": "^0.3.0",
52+
"lws-rewrite": "^1.0.1",
53+
"lws-spa": "^1.0.1",
5554
"lws-static": "^0.5.0",
56-
"node-version-matches": "^1.0.0"
55+
"node-version-matches": "^1.0.1"
5756
},
5857
"devDependencies": {
59-
"coveralls": "^3.0.2",
60-
"jsdoc-to-markdown": "^4.0.1",
61-
"req-then": "^0.6.4",
62-
"test-runner": "^0.5.0"
58+
"coveralls": "^3.0.3",
59+
"jsdoc-to-markdown": "^5.0.0",
60+
"node-fetch": "^2.6.0",
61+
"test-runner": "^0.6.0"
6362
}
6463
}

‎test/cli.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
const TestRunner = require('test-runner')
1+
const Tom = require('test-runner').Tom
22
const a = require('assert')
33
const CliApp = require('../lib/cli-app')
4-
const request = require('req-then')
4+
const fetch = require('node-fetch')
55

6-
const runner = new TestRunner()
6+
const tom = module.exports = new Tom('cli')
77

8-
runner.test('cli.run', async function () {
8+
tom.test('cli.run', async function () {
99
const port = 7500 + this.index
1010
const origArgv = process.argv.slice()
1111
process.argv = [ 'node', 'something', '--port', `${port}` ]
1212
const server = CliApp.run()
1313
process.argv = origArgv
14-
const response = await request(`http://127.0.0.1:${port}/`)
14+
const response = await fetch(`http://127.0.0.1:${port}/`)
1515
server.close()
16-
a.strictEqual(response.res.statusCode, 200)
16+
a.strictEqual(response.status, 200)
1717
})
1818

19-
runner.test('cli.run: bad option', async function () {
19+
tom.test('cli.run: bad option', async function () {
2020
const origArgv = process.argv.slice()
2121
process.argv = [ 'node', 'something', '--should-fail' ]
2222
const exitCode = process.exitCode
@@ -26,21 +26,21 @@ runner.test('cli.run: bad option', async function () {
2626
a.strictEqual(server, undefined)
2727
})
2828

29-
runner.test('cli.run: --help', async function () {
29+
tom.test('cli.run: --help', async function () {
3030
const origArgv = process.argv.slice()
3131
process.argv = [ 'node', 'something', '--help' ]
3232
CliApp.run()
3333
process.argv = origArgv
3434
})
3535

36-
runner.test('cli.run: --version', async function () {
36+
tom.test('cli.run: --version', async function () {
3737
const origArgv = process.argv.slice()
3838
process.argv = [ 'node', 'something', '--version' ]
3939
CliApp.run()
4040
process.argv = origArgv
4141
})
4242

43-
runner.test('cli.run: middleware-list', async function () {
43+
tom.test('cli.run: middleware-list', async function () {
4444
const origArgv = process.argv.slice()
4545
process.argv = [ 'node', 'something', 'middleware-list' ]
4646
CliApp.run()

‎test/test.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
const TestRunner = require('test-runner')
2-
const request = require('req-then')
1+
const Tom = require('test-runner').Tom
2+
const fetch = require('node-fetch')
33
const LocalWebServer = require('../')
44
const a = require('assert')
55

6-
const runner = new TestRunner()
6+
const tom = module.exports = new Tom('test')
77

8-
runner.test('basic', async function () {
8+
tom.test('basic', async function () {
99
const port = 9000 + this.index
1010
const localWebServer = new LocalWebServer()
1111
const server = localWebServer.listen({
1212
port: port,
1313
directory: 'test/fixture'
1414
})
15-
const response = await request(`http://localhost:${port}/one.txt`)
15+
const response = await fetch(`http://localhost:${port}/one.txt`)
1616
server.close()
17-
a.strictEqual(response.data.toString(), 'one\n')
17+
const body = await response.text()
18+
a.strictEqual(body, 'one\n')
1819
})

0 commit comments

Comments
 (0)
Please sign in to comment.