mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-17 04:14:57 +00:00
update sapper, tidy up
This commit is contained in:
@@ -6,6 +6,7 @@ const static = require('serve-static');
|
||||
|
||||
const { PORT = 3000 } = process.env;
|
||||
|
||||
// this allows us to do e.g. `fetch('/api/blog')` on the server
|
||||
const fetch = require('node-fetch');
|
||||
global.fetch = (url, opts) => {
|
||||
if (url[0] === '/') url = `http://localhost:${PORT}${url}`;
|
||||
@@ -16,9 +17,7 @@ app.use(compression({ threshold: 0 }));
|
||||
|
||||
app.use(static('assets'));
|
||||
|
||||
app.use(sapper({
|
||||
selector: '#sapper'
|
||||
}));
|
||||
app.use(sapper());
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`listening on port ${PORT}`);
|
||||
|
||||
Reference in New Issue
Block a user