Swiftpack.co - Package - bluk/spike-swift-vapor

HelloWorld

Apache-2.0 License Swift SPM Compatible Platforms

Build Status CircleCI

An experimental spike project to explore Vapor.

Getting Started

Using the Swift Package Manager, you can build and run the program:

swift build
swift run Run serve --hostname 0.0.0.0 --port 8080

And then you can visit http://127.0.0.1:8080/hello to follow a route.

Docker

You can run this application by cloning this repository and then running the following via Docker:

docker build . -t spike-swift-vapor
docker run -it --rm -p 9080:8080 --name=vapor spike-swift-vapor --port 8080

The output should be like:

Server starting on http://0.0.0.0:8080

And then you can visit http://127.0.0.1:9080/hello to follow a route. Note if you do not use --port 8080 in the docker run command, the server will default to port 8080 anyway. The -p 9080:8080 maps your host (local machine)'s 9080 port to the container's 8080 port. You can change the 9080 to any port you want on the host machine. The 8080 must match the --port argument for the server to be reachable.

To stop the container, you can run:

docker stop vapor

Development

If you wish to modify this code, you can clone this repository and use Swift Package Manager to build and test this code.

swift build
swift test

If you want to generate an Xcode project, you can run:

swift package generate-xcodeproj

License

Apache-2.0 License

Github

link
Stars: 0
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

v0.2.0 - Aug 24, 2018

v0.1.0 - Aug 23, 2018