Simple Test Server using the Async Swift Server API
- Swift Server Project HTTP APIs
- Async GCD Server Fork used here
- Tutorial: Using the Swift Server API 0.1.0
git clone https://github.com/ZeeZide/http-testserver.git
cd http-testserver
swift build
Fetching https://github.com/ZeeZide/http.git
Cloning https://github.com/ZeeZide/http.git
Resolving https://github.com/ZeeZide/http.git at feature/gcd-async-server
Compile CHTTPParser http_parser.c
Compile Swift Module 'HTTP' (9 sources)
Compile Swift Module 'http_testserver' (1 sources)
Linking ./.build/x86_64-apple-macosx10.10/debug/http-testserver
./.build/x86_64-apple-macosx10.10/debug/http-testserver
Starting server on: http://localhost:1337/
Server pages:
docker run --rm \
-v $PWD:/buildit \
-v $PWD/.build-linux:/buildit/.build \
helje5/swift-dev \
swift build --package-path /buildit
... and run it:
docker run -p 1337:1337 -d --name async-swift --rm \
-v $PWD:/buildit \
-v $PWD/.build-linux:/buildit/.build \
helje5/swift-dev \
/buildit/.build/x86_64-unknown-linux/debug/http-testserver
swift package generate-xcodeproj
open http-testserver.xcodeproj
Make sure to select the right target, then build and run.
curl -X POST --data $'Hello World\n' http://localhost:1337/echo
http-testserver is brought to you by and not from the ZeeZide. We like feedback, GitHub stars, cool contract work, presumably any form of praise you can think of. We don't like people who are wrong.
There is a swift-server.slack.com Slack group.