Skip to content

Commit

Permalink
Fix Express 4 deprecations in credentials-test-as-root
Browse files Browse the repository at this point in the history
  • Loading branch information
strugee committed Nov 6, 2017
1 parent 2975a7d commit 7820dde
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/credentials-test-as-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var assert = require("assert"),
fs = require("fs"),
path = require("path"),
express = require("express"),
http = require("http"),
multipart = require("connect-multiparty"),
DialbackClient = require("dialback-client"),
databank = require("databank"),
Databank = databank.Databank,
Expand All @@ -42,13 +44,14 @@ var tc = JSON.parse(fs.readFileSync(path.join(__dirname, "config.json")));

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

var app = express.createServer();
var app = express(),
appServer = http.createServer(app);

app.set("port", port);
app.use(express.json());
app.use(express.urlencoded());
app.use(express.multipart());
app.use(app.router);
app.use(express.urlencoded({extended: true}));
// TODO: use the multiparty API directly instead of this Connect middleware wrapper
app.use(multipart());

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

app.listen(port, hostname, function() {
callback(null, app);
callback(null, appServer);
});
};

Expand Down

0 comments on commit 7820dde

Please sign in to comment.