https://github.com/hellerve/lang-server
A simple zepto DSL for creating HTTP servers
https://github.com/hellerve/lang-server
Last synced: 2 months ago
JSON representation
A simple zepto DSL for creating HTTP servers
- Host: GitHub
- URL: https://github.com/hellerve/lang-server
- Owner: hellerve
- Created: 2016-07-17T11:46:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-02T19:37:54.000Z (over 9 years ago)
- Last Synced: 2025-04-05T22:43:47.022Z (12 months ago)
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lang-server
lang-server is a simple tool that leverages zepto #langs to
build a simple framework for simple servers.
## Installation
```
zeps install hellerve/lang-server
```
## Usage
```clojure
#lang serve
; the handle function will be called with every request
(define (handle method route headers body)
(response :body "Hello, World"))
```
After saving the file to `my-server.zp`, you can run this script using
```
zepto-serve my-server
```
For a more or less complex example leveraging a few more
possibilities, see the [example JSON server](https://github.com/hellerve/lang-server/blob/master/examples/serve-json/serve-json.zp)
or the [badge generator](https://github.com/hellerve/lang-server/blob/master/examples/badges/badges.zp).
## Known bugs
The following bugs are known:
* Sending a header that includes `: ` (colon-space) anywhere that's not the key-value
delimiter will crash the server (yay!).
Have fun!