From 448bcbff04e5e85d26cd7b8be3e893b1566f492b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20=C3=87olako=C4=9Flu?= Date: Wed, 27 Jan 2021 13:06:58 +0300 Subject: [PATCH 1/2] Added travis yml --- .env | 2 -- .travis.yml | 14 ++++++++++++++ server.js | 25 ++++++++++++++++++++----- src/Patient.js | 11 ----------- src/main.js | 6 +++--- src/router/index.js | 2 +- static.json | 7 +++++++ 7 files changed, 45 insertions(+), 22 deletions(-) delete mode 100644 .env create mode 100644 .travis.yml delete mode 100644 src/Patient.js create mode 100644 static.json diff --git a/.env b/.env deleted file mode 100644 index 3725d8c..0000000 --- a/.env +++ /dev/null @@ -1,2 +0,0 @@ -NODE_ENV=development -VUE_APP_API_BASE_URL=http://localhost:9090 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..bd22420 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +language: java +jdk: +- oraclejdk11 + +branches: + only: + - production +deploy: + provider: heroku + app: metis-portal + on: + branch: production + api_key: + secure: qcl0sqtknlTJcqQEu0rRj70h4SaRjbq5jy6j7HOr+iQIt+tSM/S/nE9g3se8AvPuIuLgD4JFVPXvQKLdBSvf3djuA0eja35cO9FWx3YGJ5boYavj1gX00cTNZChrr5HyIKDLJ2eO6MoRiFuOjT5+lLQH0xnRF4fVf1CSC/YXy/yGt8MM7GHOIYIZn/admhvibSNd70F0XtUNTXX5a25TFvyXdUrbaKafsQUNsXVuQnJPbT2VrXK5mTQHj8XQXedQMuTCfplahpHjmBXFxMtbGuXLNNTK2DwSiiSV1N7ozA65v5/B2sYwq8VqSX8za/Wy74p3YZTpueNCdZN4DORxrKUT/JiMZv2l2rqUUQsd0QiEzMoyK5FopiuCiwSeHZe14TEpwKHYMYzjQNytUKYn5aGcBWQSAkT00cyHo3q+u637H1WckFmxUJYL9Gn4unp0RopcpMAPiGgddDdVgW3LMwrMvsbwPmJ5/eIb3arF5X1FievvygkcWDZmMezZix6t4LcxS96OmxbWRAf7BxvThMZmu2KdHT/1E40ekgLtpVKpI/rJnKsvO0jSvaKOmL4UwgPdT2u6PI9bVj7++vPK8ekeIT1tn1AuMzF/C0fwSIlVdX++LSiy9bKmpNrINqjKO5JogxKmiV6zeXTuNS/anRSJyC6ACqqp8yq0SagQ8pE= diff --git a/server.js b/server.js index 9ede5dd..da6f419 100644 --- a/server.js +++ b/server.js @@ -1,5 +1,20 @@ -var express = require('express'); -var path = require('path'); -var serveStatic = require('serve-static');app = express(); -app.use(serveStatic(__dirname));var port = process.env.PORT || 5000; -app.listen(port);console.log('server started '+ port); +const http = require('http') +const fs = require('fs') +const httpPort = 80 + +http.createServer((req, res) => { + fs.readFile('index.html', 'utf-8', (err, content) => { + if (err) { + console.log('We cannot open "index.html" file.') + } + + res.writeHead(200, { + 'Content-Type': 'text/html; charset=utf-8' + }) + + res.end(content) + }) +}).listen(httpPort, () => { + console.log('Server listening on: http://localhost:%s', httpPort) +}) + diff --git a/src/Patient.js b/src/Patient.js deleted file mode 100644 index c18fe6b..0000000 --- a/src/Patient.js +++ /dev/null @@ -1,11 +0,0 @@ -export class Patient { - name; - phone; - safe; - - constructor(name, phone, safe){ - this.name = name; - this.phone = phone; - this.safe = safe; - } -} diff --git a/src/main.js b/src/main.js index 2c0e095..52c6d3f 100644 --- a/src/main.js +++ b/src/main.js @@ -14,9 +14,9 @@ const options = { Vue.use(Toast, options); //Production variables -Vue.config.productionTip = false -Vue.config.devtools = true -Vue.config.performance = true +//Vue.config.productionTip = false +//Vue.config.devtools = true +//Vue.config.performance = true new Vue({ router, diff --git a/src/router/index.js b/src/router/index.js index 9143b82..7a18831 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -24,7 +24,7 @@ const routes = [ ] const router = new VueRouter({ - mode: 'hash', + mode: 'history', base: process.env.BASE_URL, routes }) diff --git a/static.json b/static.json new file mode 100644 index 0000000..5d5b44a --- /dev/null +++ b/static.json @@ -0,0 +1,7 @@ +{ + "root": "dist", + "clean_urls": true, + "routes": { + "/**": "index.html" +} +} From 10c849c46e6cdc042da0c1fb957dd7a1924eb962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20=C3=87olako=C4=9Flu?= Date: Wed, 27 Jan 2021 13:09:19 +0300 Subject: [PATCH 2/2] updated gitignore --- .env.example | 2 ++ .gitignore | 1 + 2 files changed, 3 insertions(+) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..3725d8c --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +NODE_ENV=development +VUE_APP_API_BASE_URL=http://localhost:9090 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 403adbc..419981e 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ pnpm-debug.log* *.njsproj *.sln *.sw? +.env