This commit is contained in:
Zeke Sikelianos 2017-06-03 22:03:55 -07:00
Родитель d49fc41a6c
Коммит 2154f2d062
2 изменённых файлов: 49 добавлений и 4 удалений

Просмотреть файл

@ -8,7 +8,7 @@
"author": "GitHub",
"license": "MIT",
"scripts": {
"start": "script/server",
"start": "node server.js",
"bootstrap": "script/bootstrap",
"link-checker": "grunt linkChecker",
"test": "mocha --reporter min && standard",
@ -19,30 +19,33 @@
"build-awesome": "script/awesome",
"build-userland": "script/userland",
"build-apps": "script/apps",
"release": "script/release 2>&1 | script/notify"
"release": "script/release 2>&1 | script/notify",
"dev": "nodemon"
},
"devDependencies": {
"awesome-electron": "^2.5.0",
"chai": "^3.5.0",
"cheerio": "^0.22.0",
"dotenv": "^4.0.0",
"electron-apps": "^1.3.0",
"electron-apps": "^1.762.0",
"electron-docs": "^3.0.0",
"electron-userland-reports": "1.6.0",
"github": "^9.2.0",
"got": "^6.6.3",
"gray-matter": "^2.1.0",
"gray-matter": "^2.1.1",
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"grunt-link-checker": "^0.1.0",
"href-type": "^1.0.1",
"marky-markdown-lite": "^1.2.0",
"mocha": "^3.2.0",
"nodemon": "^1.11.0",
"npm-run-all": "^3.1.2",
"require-dir": "^0.3.1",
"semver": "^5.3.0",
"slack-notify": "^0.1.6",
"standard": "^8.6.0",
"supertest": "^3.0.0",
"titlecase": "^1.0.2",
"to-markdown": "github:zeke/to-markdown#support-markdown-it-gfm"
},
@ -53,5 +56,16 @@
"ignore": [
"/js/vendor"
]
},
"dependencies": {
"electron-i18n": "electron/electron-i18n",
"express": "^4.15.3",
"express-liquid": "^0.2.6",
"flat": "^2.0.1",
"liquid-node": "^2.6.1",
"lodash": "^4.17.4",
"node-sass-middleware": "^0.11.0",
"tinyliquid": "^0.2.34",
"tree-hugger": "^1.2.0"
}
}

31
server.js Normal file
Просмотреть файл

@ -0,0 +1,31 @@
const fs = require('fs')
const path = require('path')
const express = require('express')
const sass = require('node-sass-middleware')
const port = Number(process.env.PORT) || 5000
const app = express()
app.use(sass({
src: __dirname,
dest: __dirname,
debug: true,
// outputStyle: 'compressed',
// prefix: '/prefix' // Where prefix is at <link rel="stylesheets" href="prefix/style.css"/>
}))
app.use(express.static(__dirname))
const jexodus = require('./lib/jexodus')(__dirname).on('ready', startServer)
app.get('/', function (req, res) {
jexodus.render('/').then(output => res.send(output))
})
function startServer () {
if (module.parent) return
app.listen(port, () => {
console.log(`app running on ${port}`)
})
}
module.exports = app