Skip to content

Commit 3d42d7f

Browse files
move to express (and add some sass)
1 parent 79737e0 commit 3d42d7f

8 files changed

+1163
-83
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS_Store
22
node_modules
3-
yarn-error.log
3+
yarn-error.log
4+
css/*.css
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

index.js

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
var StaticServer = require('static-server');
2-
var server = new StaticServer({
3-
rootPath: '.', // required, the root of the server file tree
4-
port: 1337, // required, the port to listen
5-
});
6-
7-
server.start(function () {
8-
console.log('Server listening to', server.port);
9-
});
1+
const express = require('express')
2+
const sass = require('node-sass-middleware')
3+
const app = express()
4+
const port = 1337
5+
6+
app.use(express.static('./'))
7+
8+
app.use(
9+
sass({
10+
src: __dirname, //where the sass files are
11+
dest: __dirname, //where css should go
12+
debug: true // obvious
13+
})
14+
);
15+
16+
app.get('/', (req, res) => res.static('index'))
17+
18+
app.listen(port, () => console.log(`app listening on port ${port}`))

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
"sinon": "^7.2.3"
1414
},
1515
"dependencies": {
16-
"static-server": "^2.2.1"
16+
"express": "^4.16.4",
17+
"node-sass": "^4.11.0",
18+
"node-sass-middleware": "^0.11.0"
1719
},
1820
"scripts": {
1921
"dev": "node index.js",

0 commit comments

Comments
 (0)