diff --git a/buildspec.yml b/buildspec.yml new file mode 100644 index 00000000..06ea30bc --- /dev/null +++ b/buildspec.yml @@ -0,0 +1,12 @@ +version: 0.2 +artifacts: + files: + - '**/*' +phases: + install: + runtime-versions: + nodejs: 10 + build: + commands: + - npm install + - npm run build diff --git a/package.json b/package.json index b54463d8..c4cca5ed 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@angular/platform-browser-dynamic": "^8.2.7", "@angular/router": "^8.2.7", "core-js": "^2.6.9", + "express": "^4.17.1", "rxjs": "^6.5.3", "zone.js": "^0.10.2" }, diff --git a/server.js b/server.js new file mode 100644 index 00000000..821f3427 --- /dev/null +++ b/server.js @@ -0,0 +1,13 @@ +// server.js: This is a tiny NodeJS web server hosting static files from the /www folder in the Elastic Beanstalk deployment ZIP +// Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications. +var express = require('express'); +// Let's create an instance of an express web server +var app = express(); +// By default, let's use port 80, unless we provide a different value as argument or system environment variable +var port = process.env.PORT || process.argv[2] || 80; +// Let's host all the static files in /www as root of our little web server +app.use('/', express.static(__dirname + '/www')); +// Start listening on the desired port for incoming traffic +var server = app.listen(port, function () { + console.log('listening on port:', port); +});