mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-22 22:45:19 +00:00
Merge pull request #64 from lukeed/swap/sirv
Replace `serve-static` with `sirv`
This commit is contained in:
@@ -1,17 +1,17 @@
|
|||||||
|
import sirv from 'sirv';
|
||||||
import polka from 'polka';
|
import polka from 'polka';
|
||||||
import compression from 'compression';
|
|
||||||
import sapper from 'sapper';
|
import sapper from 'sapper';
|
||||||
import serve from 'serve-static';
|
import compression from 'compression';
|
||||||
import { routes } from './manifest/server.js';
|
import { routes } from './manifest/server.js';
|
||||||
import App from './App.html';
|
import App from './App.html';
|
||||||
|
|
||||||
polka() // You can also use Express
|
polka() // You can also use Express
|
||||||
.use(
|
.use(
|
||||||
compression({ threshold: 0 }),
|
compression({ threshold: 0 }),
|
||||||
serve('assets'),
|
sirv('assets'),
|
||||||
sapper({
|
sapper({ routes, App })
|
||||||
routes,
|
|
||||||
App
|
|
||||||
})
|
|
||||||
)
|
)
|
||||||
.listen(process.env.PORT);
|
.listen(process.env.PORT)
|
||||||
|
.catch(err => {
|
||||||
|
console.log('error', err);
|
||||||
|
})
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
"compression": "^1.7.1",
|
"compression": "^1.7.1",
|
||||||
"polka": "^0.3.4",
|
"polka": "^0.3.4",
|
||||||
"sapper": "^0.12.0",
|
"sapper": "^0.12.0",
|
||||||
"serve-static": "^1.13.1"
|
"sirv": "^0.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
|
|||||||
Reference in New Issue
Block a user