MicroExpress | micro web server framework on top of the official Swift | REST library
kandi X-RAY | MicroExpress Summary
kandi X-RAY | MicroExpress Summary
A micro web server framework on top of the official Swift HTTP API
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MicroExpress
MicroExpress Key Features
MicroExpress Examples and Code Snippets
$ mkdir MicroHelloWorld && cd MicroHelloWorld
$ swift package init --type executable
// swift-tools-version:4.0
import PackageDescription
let package = Package(
name: "MicroHelloWorld",
dependencies: [
.package(url: "https://github.
$ docker run --rm \
-v "${PWD}:/src" \
-v "${PWD}/.docker.build:/src/.build" \
swift:4.0.3 \
bash -c 'cd /src && swift build'
Unable to find image 'swift:4.0.3' locally
4.0.3: Pulling from library/swift
8f7c85c2269a: Pull complete
..
import MicroExpress
let app = Express()
app.get("/moo") { req, res, next in
try res.send("Muhhh")
}
app.get("/json") { _, res, _ in
try res.json([ "a": 42, "b": 1337 ])
}
app.get("/") { _, res, _ in
try res.send("Homepage")
}
app.listen(1337
Community Discussions
Trending Discussions on MicroExpress
QUESTION
I am using MicroExpress to create a web server in a SwiftUI
app. I can connect to the server when I am running the app in Simulator, but I cannot make it work on my real device.
MicroExpress (based on SwiftNIO
) creates a Webserver on the iPhone and shall expose an API in the local network.
I think I need to add a capability or something, but I cannot find the network capability nor a setting to allow incoming network connections in Xcode 11
under Signing & Capabilities
.
How do I make the app allow incoming network connections?
EDIT
I have already added Allow Arbitrary Loads
to allow HTTP
if that is necessary. I am connecting over HTTP
at the moment.
ANSWER
Answered 2019-Nov-25 at 13:51I looked at the tutorial and I think you need to bind to 0.0.0.0
instead of localhost
. Doesn't have to do with capabilities nor ATS.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MicroExpress
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page