This repository has been archived on 2026-05-01. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
PolyNotFound/server.js
2021-12-22 21:11:16 +01:00

21 lines
547 B
JavaScript

const path = require('path');
const express = require('express');
const app = express();
const port = process.env.PORT || 3000;
const cors = require('cors');
app.use(cors({
origin: [
'https://api-polynotfound.herokuapp.com/', 'http://127.0.0.1:3000'
],
credentials: true
}));
app.use(express.static(__dirname + '/dist/frontend-admin'));
app.get('/*', function(req,res) {
res.sendFile(path.join(__dirname+ '/dist/frontend-admin/index.html'));
});
app.listen(port, '0.0.0.0',() => {
console.log (`listening on port ${port}`);
});