Permalink
Browse files

API change: templates that output to json no longer use layout by def…

…ault
  • Loading branch information...
1 parent 3c28361 commit f9f131279968aec8041f408c51248abda005cfca @sintaxi committed Sep 9, 2016
Showing with 10 additions and 9 deletions.
  1. +4 −4 lib/middleware.js
  2. +1 −1 package.json
  3. +1 −1 test/apps/basic/public/shared/_debug.jade
  4. +2 −1 test/apps/basic/public/shared/_nav.jade
  5. +2 −2 test/basic.js
View
@@ -323,15 +323,15 @@ exports.mwl = function(req, rsp, next){
// `.js` (Browserify) are actually being used to specify
// source files
- if (['js'].indexOf(ext) === -1) {
+ //if (['js'].indexOf(ext) === -1) {
if (terraform.helpers.processors["html"].indexOf(ext) !== -1 || terraform.helpers.processors["css"].indexOf(ext) !== -1 || terraform.helpers.processors["js"].indexOf(ext) !== -1) {
notFound(req, rsp, next)
} else {
next()
}
- } else {
- next()
- }
+ //} else {
+ //next()
+ //}
}
/**
View
@@ -45,7 +45,7 @@
"parseurl": "1.3.0",
"pause": "0.1.0",
"send": "0.13.0",
- "terraform": "1.1.0"
+ "terraform": "1.2.0"
},
"devDependencies": {
"cheerio": "0.19.0",
@@ -1,5 +1,5 @@
h4 globals
-pre= JSON.stringify(locals, null, 2)
+pre= JSON.stringify(public, null, 2)
h4 current
pre= JSON.stringify(current, null, 2)
@@ -6,4 +6,5 @@ ul
li(class="#{ current.path[0] == 'about' ? 'current' : '' }")
a(href="/about") About
li
- a(href="/feed.atom") RSS
+ a(href="/feed.atom") RSS
+li= current.source
View
@@ -39,12 +39,12 @@ describe("basic", function(){
it("should have current vars", function(done){
var staticCurrent = require(path.join(outputPath, "current.json"))
staticCurrent.should.have.property("path")
- staticCurrent.should.have.property("source", "current")
+ staticCurrent.should.have.property("source", "current.json")
request('http://localhost:8100/current.json', function (e, r, b) {
r.statusCode.should.eql(200)
var dynamicCurrent = JSON.parse(b)
dynamicCurrent.should.have.property("path")
- dynamicCurrent.should.have.property("source", "current")
+ dynamicCurrent.should.have.property("source", "current.json")
done()
})
})

0 comments on commit f9f1312

Please sign in to comment.