Difference between revisions of "Vapor"

From Coder Merlin
(Created page with "== Configuration == In the path: {{Pathname|./Sources/App/configure.swift}}: <syntaxhighlight lang="swift"> // Set local port guard let portString = Environment.get("IGIS_LOC...")
 
m (Editorial review and minor corrections)
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Configuration ==
== Getting Started ==
In the path: {{Pathname|./Sources/App/configure.swift}}:
{{ConsoleLine|john-williams@codermerlin:~$ |<nowiki>git clone https://github.com/TheCoderMerlin/VaporShell</nowiki> }}


<syntaxhighlight lang="swift">
== Building ==
// Set local port
{{ConsoleLine|john-williams@codermerlin:~$ |build}}
guard let portString = Environment.get("IGIS_LOCAL_PORT") else {
    fatalError("Failed to determine IGIS LOCAL PORT from environment")
}
guard let port = Int(portString) else {
    fatalError("Malformed IGIS LOCAL PORT: \(portString)")
}
app.http.server.configuration.port = port


// Set local host
== Run ==
guard let hostname = Environment.get("IGIS_LOCAL_HOST") else {
{{ConsoleLine|john-williams@codermerlin:~$ |run}}
    fatalError("Failed to determine IGIS LOCAL HOST from environment")
 
}
The server then answers at https://www.codermerlin.com/vapor/(user-name)/.
app.http.server.configuration.hostname = hostname
 
</syntaxhighlight>
{{Hint|If the page doesn't load, you might be forgetting a slash at the end! This is a common problem. (It has something to do with semantics. See more at [https://stackoverflow.com/a/5949201/15982771 Stackoverflow])}}

Latest revision as of 11:25, 21 April 2024

Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

Getting Started[edit]

john-williams@codermerlin:~$  git clone https://github.com/TheCoderMerlin/VaporShell

Building[edit]

john-williams@codermerlin:~$  build

Run[edit]

john-williams@codermerlin:~$  run

The server then answers at https://www.codermerlin.com/vapor/(user-name)/.

Hint.pngHelpful Hint
If the page doesn't load, you might be forgetting a slash at the end! This is a common problem. (It has something to do with semantics. See more at Stackoverflow)