Skip to content

Commit

Permalink
Merge pull request #255 from alphagov/use-express-4
Browse files Browse the repository at this point in the history
Update GOV.UK elements to use Express 4
  • Loading branch information
gemmaleigh authored Jun 13, 2016
2 parents 6219fe4 + 2ccf142 commit 364d484
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var express = require('express'),
bodyParser = require('body-parser'),
routes = require(__dirname + '/routes.js'),
app = express(),
port = (process.env.PORT || 3000);
Expand All @@ -12,8 +13,12 @@ app.set('views', __dirname + '/views');
// Middleware to serve static assets
app.use('/public', express.static(__dirname + '/public'));
app.use('/public', express.static(__dirname + '/govuk_modules/public'));
app.use(express.json()); // to support JSON-encoded bodies
app.use(express.urlencoded()); // to support URL-encoded bodies

// Support for parsing data in POSTs
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: true
}));

// routes (found in routes.js)

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"govuk_frontend_toolkit": "^4.12.0"
},
"devDependencies": {
"body-parser": "^1.14.1",
"consolidate": "^0.10.0",
"express": "^3.18.4",
"express-writer": "0.0.4",
Expand Down

0 comments on commit 364d484

Please sign in to comment.