crystal-server
Version, currently master branch1 version
- master branchlatestSep 12, 2018
github.com/your/crystal-server
Simple example of HTTP server made using Crystal.
Installation
# Add this to your shard.yml
dependencies:
crystal-server:
github: your/crystal-server
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
- no constraint declared
- License
- MIT
- Author
- Giuseppe Lobraico
Dependencies
This version declares no dependencies.
README
crystal-server
Simple example of HTTP server made using Crystal.
How it works
This server allows GET requests in the following format:
GET /raw/html/filename-without-extension
GET /raw/js/filename-without-extension
GET /raw/css/filename-without-extension
GET /raw/bin/filename-with-extension
Files must be stored under the store/raw subfolders (html|js|css|bin) with their own extension, but they can be requested without expliciting it as long as they are not binary files (in this case, always add the extension). (Also, see: URL shorcuts)
Yes, it can handle concurrent requests.
URL shortcuts
The following conversion matrix is now available to access resources using a shorter URL:
GET /html-filename-without-extension -> /raw/html/html-filename-without-extension
GET /filename.js -> /raw/js/filename-without-extension
GET /filename.css -> /raw/css/filename-without-extension
GET /filename.jpg -> /raw/bin/filename-with-extension
Cache
Every request is cached permanently in memory, that means each file content will reside in memory as long as the process is running.
To force a cache cleanup without killing the process send a kill -SIGHUP pid.
Test
Run crystal-server and go to http://localhost:8081/raw/html/test (or http://localhost:8081/test)
TODO
Better caching and much more.
Licence: MIT
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Sep 12, 2018
- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/your/crystal-server
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 16, 2026
- Synced
- Aug 16, 2026
- Versions
- 1