文件名称:Turnstone:Nest的轻量级请求路由
文件大小:4KB
文件格式:ZIP
更新时间:2024-05-20 17:57:32
Swift
特恩斯通 轻量级请求路由。 Turnstone允许您针对处理程序注册URI模板以提供请求路由。 安装 pod 'Turnstone' 用法 import Turnstone import Inquiline let turnstone = Turnstone () turnstone. addRoute ( " / " ) { request in return Response (. Ok , body : " Root URI " ) } turnstone. addRoute ( " /tasks/{id} " ) { request, parameters in let id = parameters[ " id " ] ! return Response (. Ok , body : " Task \( id ) " ) } serve ( " localhost
【文件预览】:
Turnstone-master
----.gitignore(9B)
----Turnstone()
--------Turnstone.swift(1KB)
----Turnstone.podspec.json(823B)
----TurnstoneSpecs()
--------TurnstoneSpec.swift(1KB)
----.travis.yml(111B)
----LICENSE(1KB)
----README.md(782B)