From bb04de4b38e747a06be42d9da010375715194d6d Mon Sep 17 00:00:00 2001 From: Danijel Anđelković Date: Wed, 13 Apr 2022 14:50:08 +0200 Subject: Dodao express server za buildovan angular projekat, promenio konfiguraciju aplikacije na json fajl. --- production/app/main.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 production/app/main.js (limited to 'production/app/main.js') diff --git a/production/app/main.js b/production/app/main.js new file mode 100644 index 00000000..336f21fe --- /dev/null +++ b/production/app/main.js @@ -0,0 +1,18 @@ +const express = require('express'); +const cors = require('cors'); +const path = require('path'); + +const app = express(); + +const port = 8080; + +app.use(cors()); +app.use(express.static(path.join(__dirname, './dist'))); + +app.get(['/', '', '*'], (req, res) => { + res.sendFile(path.join(__dirname, './dist/index.html')); +}); + +app.listen(port, () => { + console.log(`Listening on port ${port}`); +}); \ No newline at end of file -- cgit v1.2.3