#Standalone
Pioneer also come with first-party integration for a standalone server. This aims to make developing with Pioneer even faster by not having to worry about setting up the server.
Under the hood, the standalone server uses the Vapor integration.
1
2
3
4
5
6
7
8
9
10
11
#Configuration
The standalone server allow some configuration to be better suited for your use case and environment.
#Port, Host, and Env
The .standaloneServer function can take specified:
- Must be a
Stringcontaining either an IP address or"localhost" - Defaults to
127.0.0.1
1
2
3
- Must be either
"development","testing","production","dev","prod", or"test".
1
2
3
#CORS
Given that the standalone option is responsible setup the server, any middleware need to be configured by the function.
To allow CORS using a middleware, .standaloneServer function can take specified CORSMiddleware.Configuration.
1
2
3
4
5
6
7
8
9
10
#Context
Configuring context with the standalone server is identical with the Vapor integration.