Skip to content

Commit 67ef52e

Browse files
committed
Fix Express 4 deprecations in credentials-test-as-root
1 parent 8750297 commit 67ef52e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/credentials-test-as-root.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ var assert = require("assert"),
2626
fs = require("fs"),
2727
path = require("path"),
2828
express = require("express"),
29+
http = require("http"),
30+
multipart = require("connect-multiparty"),
2931
DialbackClient = require("dialback-client"),
3032
databank = require("databank"),
3133
Databank = databank.Databank,
@@ -42,13 +44,14 @@ var tc = JSON.parse(fs.readFileSync(path.join(__dirname, "config.json")));
4244

4345
var tinyApp = function(port, hostname, callback) {
4446

45-
var app = express.createServer();
47+
var app = express(),
48+
appServer = http.createServer(app);
4649

4750
app.set("port", port);
4851
app.use(express.json());
49-
app.use(express.urlencoded());
50-
app.use(express.multipart());
51-
app.use(app.router);
52+
app.use(express.urlencoded({extended: true}));
53+
// TODO: use the multiparty API directly instead of this Connect middleware wrapper
54+
app.use(multipart());
5255

5356
app.get("/.well-known/host-meta.json", function(req, res) {
5457
res.json({
@@ -87,7 +90,7 @@ var tinyApp = function(port, hostname, callback) {
8790
});
8891

8992
app.listen(port, hostname, function() {
90-
callback(null, app);
93+
callback(null, appServer);
9194
});
9295
};
9396

0 commit comments

Comments
 (0)