jazz icon indicating copy to clipboard operation
jazz copied to clipboard

web server doesn't start when web-server is the only toml section

Open Arnaz87 opened this issue 5 years ago • 8 comments

In torchbear-simple-webserver, when torchbear.toml is:

[web-server]
host = "0.0.0.0:3000"

It doesn't start. Instead, one has add another sections for it to work:

[web-server]
host = "0.0.0.0:3000"
[general]
init = "init.lua"

Arnaz87 avatar Nov 21 '18 23:11 Arnaz87

Relevant parts of the code:

https://github.com/foundpatterns/torchbear/blob/63df5c5d1942e9519eaa9b6e66128bcd31a3d86b/src/lib.rs#L143-L148

https://github.com/foundpatterns/torchbear/blob/63df5c5d1942e9519eaa9b6e66128bcd31a3d86b/src/lib.rs#L184

https://github.com/foundpatterns/torchbear/blob/63df5c5d1942e9519eaa9b6e66128bcd31a3d86b/src/lib.rs#L215

Arnaz87 avatar Nov 21 '18 23:11 Arnaz87

[general]
init = "init.lua"

this is supposed to be the most basic assumption for torchbear

naturallymitchell avatar Nov 22 '18 00:11 naturallymitchell

init defaults to "init.lua", that's not the problem, the problem is that the toml needs at least two sections

Arnaz87 avatar Nov 22 '18 00:11 Arnaz87

why?

naturallymitchell avatar Nov 22 '18 00:11 naturallymitchell

The issue is that general isnt optional. I forgot I stashed that before committing, but both shouldve been optional. Will be pushing fix in a second

dariusc93 avatar Nov 22 '18 01:11 dariusc93

it still exits after first run. simple-webserver doesn't stay active.

naturallymitchell avatar Nov 22 '18 18:11 naturallymitchell

It works just fine for me with 0.6.2.

dariusc93 avatar Nov 22 '18 20:11 dariusc93

my bad.. let's see if we can get updating soon

naturallymitchell avatar Nov 22 '18 20:11 naturallymitchell