da_server
da99's Crystal Server Helper
This won't be of any use to you. It's my preferred way of setting up a server in Crystal. You should use Kemal instead.
Install & Use
Install as a crystal shard. Use in place of HTTP::Server:
s = DA_Server.new(
host: "1.1.1.1",
port: 123,
user: "www-deployer",
handlers: [HTTP::StaticFileHandler.new("Public", false)]
)
s.host == "1.1.1.1"
s.listen
#listen raises an error if the port is being used.
HTTP handlers included in this shard:
File_TypesNo_Slash_TailPublic_FilesSecure_Headers(Hard-coded to be used as the first handler.)
You can read the handler source code here.
The only other thing included in the shard are singleton methods:
.redirect_to(Int32, path, ctx).mime(file.path.with.etc)
Repository
da_server
Owner
Statistic
- 0
- 0
- 0
- 1
- 1
- over 5 years ago
- June 7, 2018
License
MIT License
Links
Synced at
Mon, 17 Nov 2025 08:41:29 GMT
Languages