Eun / http-server-action

An action that spawns an http server to serve files.
MIT License
12 stars 11 forks source link

Does this action keep the server open until the end of the workflow? #15

Closed kopax-polyconseil closed 2 years ago

kopax-polyconseil commented 2 years ago

Hello and thanks for sharing,

the doc doesn't state it, so can I please know if this action keep the server open until the end of the workflow?

If so, is there a way to kill it (other than kill -9)?

Eun commented 2 years ago

The webserver should stay open until the job ends, however there is no guarantee.

Having a kill option would be good yes. I guess somebody can implement this :)

kopax-polyconseil commented 2 years ago

Ok.

What do you mean no guarantee ? I think if there is no guarantee you should explain why, and also state it in the README file.

Eun commented 2 years ago

Well guarantee means that this action cannot guarantee the server is always running, it won’t monitor the server.

kopax-polyconseil commented 2 years ago

I think this can happen with any http service, it is not specific to this module.

This looks to be a cool add on btw: https://github.com/marketplace/actions/wait-on

kopax-polyconseil commented 2 years ago

I used the default config and when I do curl the base endpoint, I got this:

Run curl -vvvv http://localhost:3000

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 127.0.0.1:3000...
* Connected to localhost (127.0.0.1) port 3000 (#0)
> GET / HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.7[4](https://github.com/pass-culture/pass-culture-app-native/runs/8142008173?check_suite_focus=true#step:13:4).0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
<pre>
< HTTP/1.1 200 OK
< Content-Type: text/html
< Date: Thu, 01 Sep 2022 18:16:26 GMT
< Connection: keep-alive
< Keep-Alive: timeout=5
< Transfer-Encoding: chunked
< 
{ [59[4](https://github.com/pass-culture/pass-culture-app-native/runs/8142008173?check_suite_focus=true#step:13:5) bytes data]

100   [5](https://github.com/pass-culture/pass-culture-app-native/runs/8142008173?check_suite_focus=true#step:13:6)13    0   513    0     0  42750      0 --:--:-- --:--:-- --:--:-- 4[6](https://github.com/pass-culture/pass-culture-app-native/runs/8142008173?check_suite_focus=true#step:13:7)636
* Connection #0 to host localhost left intact
<a href="/_redirects">_redirects</a>
<a href="/asset-manifest.json">asset-manifest.json</a>
<a href="/images">images</a>
<a href="/index.html">index.html</a>
<a href="/iosSplashscreens">iosSplashscreens</a>
<a href="/manifest.json">manifest.json</a>
<a href="/robots.txt">robots.txt</a>
<a href="/service-worker.js">service-worker.js</a>
<a href="/service-worker.js.LICENSE.txt">service-worker.js.LICENSE.txt</a>
<a href="/service-worker.js.map">service-worker.js.map</a>
<a href="/static">static</a>
</pre>

It seems it can't load default index.html as entry point. do you know how I can do that ?

Eun commented 2 years ago

Well maybe you should also request index.html Using

curl http://localhost:3000/index.html
kopax-polyconseil commented 2 years ago

Thisis what we did, that was the only way.