mirror of
https://github.com/techno-tim/littlelink-server.git
synced 2024-11-29 06:35:38 +01:00
84b1a800c7
* feat(rewrite): Rewrote the whole thing in ReactJS 💅
* chore(docs): Updated
29 lines
627 B
JavaScript
29 lines
627 B
JavaScript
/* eslint-disable no-console */
|
|
import express from 'express';
|
|
|
|
let app = require('./server').default;
|
|
|
|
if (module.hot) {
|
|
module.hot.accept('./server', () => {
|
|
console.log('🔁 HMR Reloading `./server`...');
|
|
try {
|
|
app = require('./server').default;
|
|
} catch (error) {
|
|
console.error(error);
|
|
}
|
|
});
|
|
console.info('✅ Server-side HMR Enabled!');
|
|
}
|
|
|
|
const port = process.env.PORT || 3000;
|
|
|
|
export default express()
|
|
.use((req, res) => app.handle(req, res))
|
|
.listen(port, err => {
|
|
if (err) {
|
|
console.error(err);
|
|
return;
|
|
}
|
|
console.log(`> Started on port ${port}`);
|
|
});
|