Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.
/ http-testserver Public archive

Simple Test Server using the Async Swift Server API

Notifications You must be signed in to change notification settings

ZeeZide/http-testserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

http-testserver

Swift4 macOS tuxOS Travis

Simple Test Server using the Async Swift Server API

Setup

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:

Build in Linux using Docker4Mac

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

Xcode

swift package generate-xcodeproj
open http-testserver.xcodeproj

Make sure to select the right target, then build and run.

CURL

curl -X POST --data $'Hello World\n' http://localhost:1337/echo

Who

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.