Skip to content

Commit

Permalink
Made it possible to run receipt locally (#7962)
Browse files Browse the repository at this point in the history
* Made it possible to run receipt locally

* Update src/development/loadbalancer/nginx.conf

Co-authored-by: Ivar Nesje <[email protected]>

* Added error page

* updates

* LF

Co-authored-by: Ivar Nesje <[email protected]>
  • Loading branch information
TheTechArch and ivarne authored Feb 7, 2022
1 parent b4a64a6 commit e593645
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion TestData/Register/Party/500802.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"partyId": "500802",
"partyTypeName": 2,
"orgNumber": "910423185",
"orgNumber": "910423495",
"ssn": null,
"unitType": "AS",
"name": "EAS Health Consulting Svolvær",
Expand Down
21 changes: 21 additions & 0 deletions loadbalancer/502Receipt.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Receipt is not running</title>
</head>
<body>
<h1>502 Bad Gateway</h1>
<h2>Receipt is not running</h2>
<p>Please ensure that Receipt is running on port 5060</p>
<pre>
Open a terminal in src/Altinn.Platform/Altinn.Platform.Receipt
run yarn --immutable
run yarn run gulp-install-deps
run yarn run gulp (if running for the first time, otherwise this can be skipped)
run yarn run gulp-develop if need for changing fronend code, dotnet run if only needing standard receipt
</pre>
</body>
</html>
16 changes: 16 additions & 0 deletions loadbalancer/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ http {
server host.docker.internal:5005;
}

upstream receiptcomp {
server host.docker.internal:5060;
}

server {
listen 80;
server_name altinn3local.no localhost;
Expand Down Expand Up @@ -43,6 +47,15 @@ http {
proxy_pass http://localtest/Home/;
}

location /receipt/ {
proxy_pass http://receiptcomp/receipt/;
error_page 502 /502Receipt.html;
}

location /storage/ {
proxy_pass http://localtest/storage/;
}

location /localtestresources/ {
proxy_pass http://localtest/localtestresources/;
}
Expand All @@ -55,6 +68,9 @@ http {
location /502App.html {
root /www;
}
location /502Receipt.html {
root /www;
}

}
}
1 change: 0 additions & 1 deletion src/Controllers/Storage/TextsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public async Task<ActionResult<TextResource>> Create(string org, string app, [Fr
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[Produces("application/json")]
[Authorize]
public async Task<ActionResult<TextResource>> Get(string org, string app, string language)
{
try
Expand Down

0 comments on commit e593645

Please sign in to comment.