Altinn / app-localtest

Solution for testing apps locally on your own machine
8 stars 14 forks source link

Bugfix make podman work on fedora, apple silicone and windows OS #74

Closed tjololo closed 7 months ago

tjololo commented 8 months ago

Description

This started out as a fix for new apple silicone but got bigger as problems in other OSes was discovered.

Related Issue(s)

Verification

Documentation

tjololo commented 8 months ago

Reserving 8080 for something else all of a sudden is a bold move, I think. We'll need to update lots of Cypress tests in app-frontend, as this change will break them all - and will even break them in a way where our changes will be broken unless people upgrade their localtest. Could you select an other port, for example 8000?

Not hell bent on 8080 so if this leads to alot of problems we can find another default port for localtest. Any suggestions as to what port we should choose? 8180, 8181? Is there any way we can check if there is a running frontend locally, we can "scan" a range of ports in localtest and just make them available in the list if they are present

olemartinorg commented 8 months ago

I'd suggest something simple and easy to remember, such as 8000 or 3000 (although that is frequently used by other projects).

Is there any way we can check if there is a running frontend locally, we can "scan" a range of ports in localtest and just make them available in the list if they are present

Great idea! You can start at 8080 and the next ports as far as it goes (8081, 8082, 8083+). One way to 'detect' webpack is to just request http://localhost:8080/ and see if you get this back:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /</pre>
</body>
</html>

Otherwise you can request http://localhost:8080/altinn-app-frontend.css. That takes far less time to return a value than the js file, at least.