/template

A Vapor 2 template for Nodes.

Primary LanguageSwiftMIT LicenseMIT

Nodes Template

Language Build Status 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

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.

📄 License

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