Code Monkey home page Code Monkey logo

connect-jade-static's People

Contributors

fluxxu avatar jantimon avatar ruffrey avatar runk avatar thecatontheflat avatar vogelsgesang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

connect-jade-static's Issues

404 errors

Hi,

I am using the latest version of connect-jade-static ( 0.1.5 ).
Unfortunately it is now sending 404 errors.

My usecase is that I have multiple middlewares e.g.

  var express = require('express');
  var app = express();
  app.use(jadeStatic({
    baseDir: publicDirectory,
    baseUrl: baseUrl
  }));
  app.use(express.static(publicDirectory));

The public folder contains three files:

  • index.jade
  • demo.html
  • styles.css

As there is no valid template for styles.css connect-jade-static returns 404 although the styles.css file exists and the connect-jade-static middle ware is not responsible.
Same thing happens for demo.html

Could you please call next() if you can't find a tpl for the request url?
It would be in https://github.com/runk/connect-jade-static/blob/master/index.js#L27

Recommendations for migrating to pug?

EDIT: It seems like connect-jade-static was an unused dependency of the project I'm looking at. Leaving this open in case it helps anyone with similar issues

For example, a new major release could be published that supported pug instead of jade, add .pug to ext and allowedExt, and warn if files still end in .jade the first time they get loaded.

The following patch seems to be the minimum needed to switch to pug (version is arbitrary). npm test passes with that.

Or would you recommend another project - I'm not sure of the status of this repo

diff --git a/index.js b/index.js
index 927e648..1a2ddf8 100644
--- a/index.js
+++ b/index.js
@@ -1,6 +1,6 @@
 var path = require('path'),
   fs = require('fs'),
-  jade = require('jade'),
+  jade = require('pug'),
   url = require('url'),
   assert = require('assert');
 
diff --git a/package.json b/package.json
index e29229b..dee4cab 100644
--- a/package.json
+++ b/package.json
@@ -21,7 +21,7 @@
     "compile"
   ],
   "dependencies": {
-    "jade": "*"
+    "pug": "^2.0.4"
   },
   "devDependencies": {
     "mocha": ">=1.12.0"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.