Skip to content

Commit

Permalink
Merge pull request #13 from szenti/master
Browse files Browse the repository at this point in the history
chore(npm): add nsp check and koa-pug
  • Loading branch information
sonicoder86 authored Sep 1, 2016
2 parents 5aedca5 + bf8b48d commit ef4ec62
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ node server.js

### Dynamic View

This middleware is a wrapper for [koa-jade](https://github.com/chrisyip/koa-jade).
This middleware is a wrapper for [koa-pug](https://github.com/chrisyip/koa-pug).

| Param | Type | Description |
| ----- | ----- | ----------- |
| __path__ | `String` | Path to the jade files |
| __path__ | `String` | Path to the pug files |

``` javascript
app.addDynamicViewMiddleware(path);
Expand All @@ -84,7 +84,7 @@ This middleware is a wrapper for [koa-jade](https://github.com/chrisyip/koa-jade

| Param | Type | Description |
| ----- | ----- | ----------- |
| __path__ | `String` | Path to error page jade template |
| __path__ | `String` | Path to error page pug template |

``` javascript
app.addErrorHandlerMiddleware(path);
Expand Down
6 changes: 3 additions & 3 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var http = require('http');
var https = require('https');
var serve = require('koa-static');
var cors = require('koa-cors');
var Jade = require('koa-jade');
var Pug = require('koa-pug');
var errorHandlerMiddleware = require('./middlewares/error-handler');
var methodOverride = require('koa-methodoverride');
var HookMiddlewareFactory = require('./middlewares/hook');
Expand Down Expand Up @@ -59,12 +59,12 @@ App.prototype = {


addDynamicViewMiddleware: function(root, cache) {
var jadeMiddleware = new Jade({
var pugMiddleware = new Pug({
viewPath: root,
noCache: !cache
});

jadeMiddleware.use(this.koaApp);
pugMiddleware.use(this.koaApp);
},


Expand Down
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "mocha $(find . -name \"*.spec.js\" -not -path \"./node_modules/*\") --require co-mocha",
"test": "mocha $(find . -name \"*.spec.js\" -not -path \"./node_modules/*\") --require co-mocha && nsp check",
"prepublish": "npm test",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
Expand All @@ -24,23 +24,24 @@
"homepage": "https://github.com/emartech/boar-server",
"devDependencies": {
"chai": "3.5.0",
"co-mocha": "1.1.2",
"mocha": "2.5.3",
"co-mocha": "1.1.3",
"mocha": "3.0.2",
"nsp": "2.6.1",
"semantic-release": "4.3.5",
"sinon": "1.17.4"
"sinon": "1.17.5"
},
"dependencies": {
"app-root-path": "1.2.1",
"app-root-path": "1.3.0",
"koa-bodyparser": "2.2.0",
"koa-cors": "0.0.16",
"koa-helmet": "1.0.0",
"koa-jade": "2.1.0",
"koa-pug": "3.0.0-0",
"koa-methodoverride": "2.0.0",
"koa-requestid": "1.0.0",
"koa-router": "5.4.0",
"koa-ssl": "2.0.0",
"koa-static": "2.0.0",
"lodash": "4.13.1",
"logentries-logformat": "0.1.4"
"lodash": "4.15.0",
"logentries-logformat": "0.2.0"
}
}

0 comments on commit ef4ec62

Please sign in to comment.