diff options
author | Danijel Anđelković <adanijel99@gmail.com> | 2022-04-13 14:50:08 +0200 |
---|---|---|
committer | Danijel Anđelković <adanijel99@gmail.com> | 2022-04-13 14:50:08 +0200 |
commit | bb04de4b38e747a06be42d9da010375715194d6d (patch) | |
tree | b6e3c8ed0c1876154ef44053b6962ce95c4ee82c /production/app/main.js | |
parent | bd4a76b61074745735a7c775b0dd24999a4c55fc (diff) |
Dodao express server za buildovan angular projekat, promenio konfiguraciju aplikacije na json fajl.
Diffstat (limited to 'production/app/main.js')
-rw-r--r-- | production/app/main.js | 18 |
1 files changed, 18 insertions, 0 deletions
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 |