18 lines
560 B
JavaScript
18 lines
560 B
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
const http = require('http');
|
|
const { join } = require('path');
|
|
const polka = require('polka');
|
|
const sirv = require('sirv');
|
|
|
|
const { PORT=3000 } = process.env;
|
|
const files = sirv('dist');
|
|
const server = http.createServer();
|
|
|
|
polka({ server }).use(files).listen(PORT, err => {
|
|
if (err) throw err;
|
|
console.log(`> Running on localhost:${PORT}`);
|
|
});
|