Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

ml-archive/template-old

Repository files navigation

Nodes Vapor 1 Template

Swift Version Vapor Version Circle CI codebeat badge Readme Score GitHub license

A basic, test-ready Vapor template.

Getting started 🚀

This template has everything ready to go. Just create a new project using Vapor toolbox.

vapor new MyApp --template=nodes-vapor/template-old

Project layout 🗂

Due to the fact that Droplet.run is a blocking call and that XCTest has difficulty testing Applications, the project is split up into two modules: App and AppLogic. App contains the main.swift and is used for building the main executable. AppLogic is where all of your server's code will be and is the module used for tests. When you add a source file to your project please make sure it's a member of the AppLogic module.

Xcode project 🔨

Vapor toolbox makes it simple to generate a project for Xcode.

vapor xcode -y

Starting your server 🏁

In Xcode, select the Appfig.1 scheme if you want to startup your server.

Image of App module

Testing your code ⏱

For testing, make sure to have the NodesVaporAppfig. 2 selected.

Image of NodesVaporApp module

Now, you can use ⌘U like usual.

Image of example test

🏆 Credits

This package is developed and maintained by the Vapor team at Nodes. The package owner for this project is Steffen.

📄 License

This package is open-sourced software licensed under the MIT license