-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kull Zacharias (IT-SCF-F-BIM)
committed
May 23, 2024
1 parent
b76611d
commit 75cc252
Showing
21 changed files
with
624 additions
and
4,848 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,4 +56,8 @@ typings/ | |
|
||
dist | ||
|
||
build | ||
build | ||
|
||
config.json | ||
|
||
server.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
var express = require('express'); | ||
var https = require('https'); | ||
var fs = require('fs'); | ||
var { createProxyMiddleware } = require('http-proxy-middleware'); | ||
var config = require('./config.json'); | ||
if (!config.bitbucketServerUrl) throw new Error("bitbucketServerUrl missing in config.json"); | ||
if (!config.port) throw new Error("port missing in config.json"); | ||
if (!config.sslKeyFile) throw new Error("sslKeyFile missing in config.json"); | ||
if (!config.sslCertFile) throw new Error("sslCertFile missing in config.json"); | ||
|
||
/** | ||
* Configure proxy middleware | ||
*/ | ||
var bitbucketServerProxy = createProxyMiddleware({ | ||
target: config.bitbucketServerUrl, | ||
pathRewrite: {'^/api/server' : ''}, | ||
changeOrigin: true | ||
}); | ||
var devProxy = createProxyMiddleware({ | ||
target: 'http://localhost:5173/', | ||
}); | ||
|
||
var app = express(); | ||
app.use('/api/server', bitbucketServerProxy); | ||
//app.use('/', express.static('build')); | ||
app.use('/', devProxy); // use to forward to dev server started with `yarn start | ||
|
||
var privateKey = fs.readFileSync(config.sslKeyFile, 'utf8'); | ||
var certificate = fs.readFileSync(config.sslCertFile, 'utf8'); | ||
var options = {key: privateKey, cert: certificate}; | ||
https.createServer(options, app).listen(config.port); | ||
|
||
console.log('Server and Proxy started, open https://localhost:'+config.port); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.