Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: express static content path and upgrade express to v4 #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
25 changes: 11 additions & 14 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*jshint node:true */

var express = require('express');
var http = require('http');
var path = require('path');
var glob = require('glob');
var fs = require('fs');
var content = require('./lib/static_content');
const express = require('express');
const http = require('http');
const path = require('path');
const glob = require('glob');
const fs = require('fs');
const content = require('./src/static_content');

var schema_dir = path.resolve(process.cwd(), process.env.SCHEMA_DIR || 'schemata');
var schemata = [];
Expand All @@ -21,14 +21,11 @@ var dust_templates = content.dustTemplates();

var app = express();

app.configure(function () {
app.set('port', process.env.PORT || 8124);
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(require('less-middleware')({ src: __dirname + '/public' }));
app.use(express.static(path.join(__dirname, 'public')));
});
app.set('port', process.env.PORT ?? 8080);
app.use(require('morgan')('combined'));
app.use(require('body-parser').json());
app.use(require('less-middleware')(__dirname + '/public'));
app.use(express.static(path.join(__dirname, 'public')));

app.get('/', function (req, res) {
content.topLevelHTML([], {schemata: schemata}, function (err, html) {
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@
"debug": "^4.0.1",
"dustjs-helpers": "1.1.0",
"dustjs-linkedin": "1.1.1",
"express": "3.0.0rc5",
"glob": "3.1.14",
"jest": "^23.6.0",
"less": "1.3.0",
"less-middleware": "0.1.7",
"optimist": "0.3.5",
"uglify-js": "1.3.3",
"underscore": "1.4.2"
},
"devDependencies": {
"wd": "0.0.32"
"body-parser": "^1.19.0",
"express": "^4.17.1",
"glob": "^7.1.6",
"less-middleware": "^2",
"morgan": "^1.10.0"
},
"engines": {
"node": ">=10.10.x"
Expand Down
12 changes: 6 additions & 6 deletions public/stylesheets/bootstrap/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -558,13 +558,13 @@
.core (@gridColumnWidth, @gridGutterWidth) {

.spanX (@index) when (@index > 0) {
(~".span@{index}") { .span(@index); }
//(~".span@{index}") { .span(@index); } // not allowed in less-middleware > 1
.spanX(@index - 1);
}
.spanX (0) {}

.offsetX (@index) when (@index > 0) {
(~".offset@{index}") { .offset(@index); }
//(~".offset@{index}") { .offset(@index); } // not allowed in less-middleware > 1
.offsetX(@index - 1);
}
.offsetX (0) {}
Expand Down Expand Up @@ -603,14 +603,14 @@
.fluid (@fluidGridColumnWidth, @fluidGridGutterWidth) {

.spanX (@index) when (@index > 0) {
(~".span@{index}") { .span(@index); }
//(~".span@{index}") { .span(@index); } // not allowed in less-middleware > 1
.spanX(@index - 1);
}
.spanX (0) {}

.offsetX (@index) when (@index > 0) {
(~'.offset@{index}') { .offset(@index); }
(~'.offset@{index}:first-child') { .offsetFirstChild(@index); }
//(~'.offset@{index}') { .offset(@index); } // not allowed in less-middleware > 1
//(~'.offset@{index}:first-child') { .offsetFirstChild(@index); } // not allowed in less-middleware > 1
.offsetX(@index - 1);
}
.offsetX (0) {}
Expand Down Expand Up @@ -653,7 +653,7 @@
.input(@gridColumnWidth, @gridGutterWidth) {

.spanX (@index) when (@index > 0) {
(~"input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index}") { .span(@index); }
//(~"input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index}") { .span(@index); } // not allowed in less-middleware > 1
.spanX(@index - 1);
}
.spanX (0) {}
Expand Down
Loading