
Armor – Simple HTTP server, supports HTTP/2 and auto TLS - vishr
https://github.com/labstack/armor
======
e12e
Eh...: "Armor accepts configuration in JSON format, command-line option -c can
be used to specify a config file, e.g. armor -c config.json."

Ok, it might be better than Apache's mongrel mix of not-quite and SGML/XML
dialect -- but I'd much rather see something like YAML than having to write
JSON by hand. I suppose I should just write a compiler (or use one, I'm sure
simple YAML maps pretty well 1:1 to simple JSON).

~~~
JimmyM
What's wrong with writing JSON by hand? I've never touched YAML before, but
JSON seems pretty clear to me - doesn't feel much different to writing a list
naturally.

Is YAML one of those things that proper professional programmers need but us
amateurs can botch our way around?

~~~
pygy_
The YAML spec is huge, too large IMO for config files (you can use it while
knowing only a subset, but you'll be lost as soon as someone uses a feature
you don't know).

I think TOML strikes a good ballance between simplicity and features for
config files. It ends up being easy to read and write.

[https://github.com/toml-lang/toml](https://github.com/toml-lang/toml)

~~~
crdoconnor
I wrote a layer around an existing parser that refuses to parse anything
except that subset that most people use 99% of the time:

[https://github.com/crdoconnor/strictyaml](https://github.com/crdoconnor/strictyaml)

IMO TOML is syntactically messy, especially when dealing with hierarchical
data, and a whole new config format to deal with the fact that YAML has _too
many_ features is somewhat unnecessary.

------
jwcrux
Why would I want to use this over something like Caddy?

~~~
nikolay
This is based on Echo v3, which is a ultra fast web server framework, but,
again, we need to see benchmarks of Armor vs Caddy.

~~~
insertnickname
Echo is fast largely because it is based on Go's standard library net/http
server, the same as Caddy.

~~~
ngrilly
Not really. Echo can use net/http or fasthttp. When using net/http, there is
no significant performance gain. All the performance benefit comes from
replacing net/http by fasthttp.

Source:
[https://github.com/labstack/echo/tree/v3](https://github.com/labstack/echo/tree/v3)

~~~
insertnickname
But Echo v3, which Armor is based on, does not support fasthttp.

~~~
ngrilly
Thanks, I missed that!

------
ofiner2
can it be used as a library? for a go web app which already uses built-in http
server?

~~~
michaelmior
As the README mentions, it's built on the Echo[0] framework. You would likely
just want to use Echo directly if you want to embed the server in your app.

[0] [https://github.com/labstack/echo](https://github.com/labstack/echo)

------
arno1
Eh... if only the configuration was in YAML (or TOML)...

------
mostafah
+1 for not saying “written in Go” in the title.

