Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance/feature docker deploy #1011

Merged
merged 51 commits into from
Jan 25, 2023
Merged
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9505223
`update` logs for `PROD` server
migbash Jan 16, 2023
077b120
`update` for `Makefile`
migbash Jan 16, 2023
cf615e5
`update` for `.dockerignore`
migbash Jan 16, 2023
3aa29dd
`setup` of `Docker` development env
migbash Jan 16, 2023
034611c
`update` for `package.json` with `scripts:`
migbash Jan 16, 2023
e351418
`.gitignore` update
migbash Jan 16, 2023
a54cf44
`update` for `Docker` in `PROD` deployment
migbash Jan 16, 2023
843693d
`update` Makefile
migbash Jan 16, 2023
6bcb364
`update` for `README.md`
migbash Jan 16, 2023
3bd9336
`update` express server for `https`
migbash Jan 17, 2023
1054a51
add `new` deploy script with `Github Actions`
migbash Jan 17, 2023
f006710
`update` github actions test
migbash Jan 17, 2023
8e00ee2
`revert` for `http` only support
migbash Jan 17, 2023
36d4a25
`update` for `Makefile`
migbash Jan 17, 2023
c74a934
`update` for `deploy.yml`
migbash Jan 17, 2023
112e6fa
`revert` for `http` only support
migbash Jan 17, 2023
f721044
`add` for `https` deploy
migbash Jan 17, 2023
0e77f63
`update` - `Makefile`
migbash Jan 17, 2023
875d568
`update` - `my-server.js`
migbash Jan 17, 2023
fa930e3
issue `990`
migbash Jan 19, 2023
a2c55e9
issue `990` - `V1`
migbash Jan 19, 2023
1ad9c5f
issue #949
migbash Jan 19, 2023
5fcf56c
`update` packages
migbash Jan 24, 2023
46997a5
`update` for `github/actions`
migbash Jan 24, 2023
3da4ddb
issue #986
migbash Jan 24, 2023
0f27027
`logs` update
migbash Jan 24, 2023
f2da8f8
`update` for `settings.json`
migbash Jan 24, 2023
db11ce8
`update` issue #986
migbash Jan 24, 2023
bc96c2a
`update` for `mobile` view `auth`
migbash Jan 24, 2023
a88109d
`revert` express for `heroku`
migbash Jan 24, 2023
fcb6683
`revert` express for `heroku`
migbash Jan 24, 2023
6c216e8
`revert` express for `heroku`
migbash Jan 24, 2023
6adfd3c
`revert` for `DEV` test `heroku`
migbash Jan 24, 2023
d78d3a4
`revert` for `DEV` test `heroku`
migbash Jan 24, 2023
425ebc6
`revert` for `DEV` test `heroku`
migbash Jan 24, 2023
15209d3
`add` back `AuthWidget`
migbash Jan 24, 2023
f47bed7
issue #1004
migbash Jan 24, 2023
9e9e6e7
issue #1004
migbash Jan 24, 2023
651875d
issue #1004 `checkout`
migbash Jan 25, 2023
6d754bc
`update` example widget
migbash Jan 25, 2023
1ba4df6
issue #1004
migbash Jan 25, 2023
9bd80e9
issue #1004 `dark-mode` hovers
migbash Jan 25, 2023
cca20ec
issue #1004 `🐞 debug`
migbash Jan 25, 2023
5d7ecda
issue #1004 `🐞 debug`
migbash Jan 25, 2023
f75b50d
issue #1004
migbash Jan 25, 2023
168c129
issue #1004 `🐞 debug update`
migbash Jan 25, 2023
08be06a
`revert` to `PROD` of `express-server`
migbash Jan 25, 2023
0431735
`deepsource` JS-0239
migbash Jan 25, 2023
0d20204
`deepsource` JS-0239
migbash Jan 25, 2023
205585c
`deepsource` JS-0242
migbash Jan 25, 2023
15e3d26
`deepsource` JS-T1001
migbash Jan 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
revert express for heroku
  • Loading branch information
migbash committed Jan 24, 2023
commit 6c216e8b8b2d430f7e8fdb3b95650b308c13f547
40 changes: 9 additions & 31 deletions my-server.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
// [ℹ] https://github.com/sveltejs/kit/tree/master/packages/adapter-node#custom-server
// [ℹ] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
import express from 'express';
// import http from 'http';
// import https from 'https';

import express from 'express';
import { handler } from './build/handler.js';
// import sslRedirect from 'heroku-ssl-redirect';
import compression from 'compression'; // https://expressjs.com/en/resources/middleware/compression.html
import * as sslify from 'express-sslify';
import * as requestIp from 'request-ip'; // https://www.npmjs.com/package/request-ip

// import fs from 'fs';

// var options = {
// key: fs.readFileSync('./certs/privkey.pem'),
// cert: fs.readFileSync('./certs/cert.pem'),
// }
// ;

const app = express();

/**
@@ -75,12 +65,12 @@ app.get('/getClientIP', (req, res) => {
* [ℹ] https://jaketrent.com/post/https-redirect-node-heroku
* [ℹ] https://webdva.github.io/how-to-force-express-https-tutorial
*/
// app.use((req, res, next) => {
// if (req.header('x-forwarded-proto') !== 'https')
// res.redirect(`https://${req.header('host')}${req.url}`);
// else
// next();
// });
app.use((req, res, next) => {
if (req.header('x-forwarded-proto') !== 'https')
res.redirect(`https://${req.header('host')}${req.url}`);
else
next();
});

/**
* [ℹ] https://www.npmjs.com/package/express-sslify
@@ -102,17 +92,5 @@ app.use(handler);
* [ℹ] https://stackoverflow.com/questions/15693192/heroku-node-js-error-web-process-failed-to-bind-to-port-within-60-seconds-o
*/
app.listen(process.env.PORT || 5000, () => {
console.log(`listening on port ${process.env.PORT}`);
});

// ~~~~~~~~~~~~~~~~~~~~~~
// APP SPIN-UP [PROD] [V2]
// ~~~~~~~~~~~~~~~~~~~~~~

// http.createServer(app).listen(80, function(){
// console.log(`[HTTP | Server]: Server is running on port: ${80}`);
// });

// https.createServer(options, app).listen(443, function(){
// console.log(`[HTTPS | Server]: Server is running on port: ${443}`);
// });
console.log('listening on port 5000');
});