Skip to content

Commit 1b29e94

Browse files
committed
ES6-ify check-broken-links.js.
1 parent d02b1e5 commit 1b29e94

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

build/check-broken-links.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
'use strict'
44

55
/*!
6-
* Script to start a local http server and run broken-link-checker on the Bootstrap documentation site.
6+
* Script to start a local http server and run broken-link-checker
7+
* on the Bootstrap documentation site.
78
* Copyright 2017 The Bootstrap Authors
89
* Copyright 2017 Twitter, Inc.
910
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1011
*/
1112

12-
var finalhandler = require('finalhandler')
13-
var http = require('http')
14-
var serveStatic = require('serve-static')
15-
var Blc = require('broken-link-checker/lib/cli')
13+
const finalhandler = require('finalhandler')
14+
const http = require('http')
15+
const serveStatic = require('serve-static')
16+
const Blc = require('broken-link-checker/lib/cli')
1617

1718
function main(args) {
1819

@@ -22,16 +23,16 @@ function main(args) {
2223
process.exit(1)
2324
}
2425

25-
var directory = args[0]
26-
var port = args[1]
26+
const directory = args[0]
27+
const port = args[1]
2728

28-
var serve = serveStatic(directory)
29-
var server = http.createServer(function onRequest(req, res) {
29+
const serve = serveStatic(directory)
30+
const server = http.createServer(function onRequest(req, res) {
3031
serve(req, res, finalhandler(req, res))
3132
})
3233

33-
server.listen(port, function () {
34-
new Blc().input(['http://localhost:' + port].concat(args.slice(2)))
34+
server.listen(port, () => {
35+
new Blc().input([`http://localhost:${port}`].concat(args.slice(2)))
3536
})
3637
}
3738

0 commit comments

Comments
 (0)