Swift HTTP Server
Simple HTTP implementation for Swift using POSIX socket API. Running on Mac OS X and Linux.
For Mac users: You can install new Swift compiler following this instruction then you will be able to build the code directly on your Xcode.
Compile
Run the following command to compile the source:
swift build
Run
After successfully compile, run the server with:
.build/debug/example
Now, go to http://localhost:8080 to test, the response should be: Hello World
Setting up Docker container from Dockerfile
Go to docker folder and run build.sh to build swiftbox image
cd docker
./build.sh
Run new container from swiftbox image, mount your working directory and expose the port:
docker run -it -p 8080:8080 -v /path/to/your/host/working/folder:/src swiftbox
Now you can go to /src folder, which linked to your /pa