Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Fix #302: express mobifyjs symbol-link/directory-alias #303

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@
"description": "Mobify.js is an open source library for improving responsive sites by providing responsive images, JS/CSS optimization, Adaptive Templating and more.",
"author": "Mobify <[email protected]>",
"devDependencies": {
"connect-modrewrite": "^0.7.11",
"express": "3.3.1",
"grunt": "~0.4.0",
"grunt-requirejs": "~0.4.0",
"grunt-contrib-watch": "~0.2.x",
"grunt-contrib-qunit": "~0.2.0",
"grunt-browserify": "~1.3.1",
"grunt-contrib-connect": "~0.1.0",
"grunt-saucelabs": "8.3.2",
"grunt-s3": "0.2.0-alpha.2",
"grunt-contrib-qunit": "~0.2.0",
"grunt-contrib-uglify": "~0.2.0",
"grunt-jekyll": "~0.3.6",
"grunt-contrib-watch": "~0.2.x",
"grunt-express": "~0.3.6",
"grunt-jekyll": "~0.3.6",
"grunt-release": "~0.6.0",
"grunt-browserify": "~1.3.1",
"grunt-requirejs": "~0.4.0",
"grunt-s3": "0.2.0-alpha.2",
"grunt-saucelabs": "8.3.2",
"hbs": "~2.3.0",
"request": "~2.44.0"
},
Expand Down
11 changes: 10 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
var http = require('http');
var express = require('express');
var modRewrite = require('connect-modrewrite');
var fs = require('fs');
var path = require('path');
var Url = require('url');
Expand Down Expand Up @@ -174,7 +175,7 @@ var jazzcatJs = function(req, res) {
};

// Load scripts for the mock mock Jazzcat API.
var resourcesUrl = '/mobifyjs/performance/resources/samplescripts/';
var resourcesUrl = '/performance/resources/samplescripts/';
var files = fs.readdirSync(__dirname + resourcesUrl).filter(function(folder) {
return folder[0] !== '.';
});
Expand Down Expand Up @@ -244,6 +245,12 @@ var fakeJPEG = function(req, res) {

var app = express();

app.use(modRewrite([
'^/mobifyjs/(.*) /$1 [L]'
]));



app.set('views', __dirname + '/performance');
app.set('view engine', 'html');
app.engine('html', require('hbs').__express);
Expand All @@ -253,6 +260,8 @@ app.use(function(req, res, next) {
next();
});



app.get('/build/mobify(.min)?.js', cachedResponse);
app.get('/tests/fixtures/split*', slowResponse);
app.get('/tests/fixtures/tag/*', inlineTag);
Expand Down