mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-12 02:15:17 +00:00
add PORT back, fixes #48
This commit is contained in:
@@ -6,6 +6,8 @@ import serve from 'serve-static';
|
||||
import fetch from 'node-fetch';
|
||||
import { routes } from './manifest/server.js';
|
||||
|
||||
const { PORT } = process.env;
|
||||
|
||||
// this allows us to do e.g. `fetch('/api/blog-posts')` on the server
|
||||
global.fetch = (url, opts) => {
|
||||
if (url[0] === '/') url = `http://localhost:${PORT}${url}`;
|
||||
@@ -17,4 +19,4 @@ polka()
|
||||
.use(compression({ threshold: 0 }))
|
||||
.use(serve('assets'))
|
||||
.use(sapper({ routes }))
|
||||
.listen(process.env.PORT);
|
||||
.listen(PORT);
|
||||
|
||||
Reference in New Issue
Block a user