Meridian

0.0.2

Meridian is a web server written in Swift that lets you write your endpoints in a declarative way.
khanlou/Meridian

What's New

2020-09-06T22:17:58Z
  • Route groups, with error renderer overrides
  • Method Property Wrapper
  • Header Property Wrapper
  • Path Property Wrapper
  • Support for custom property wrappers
  • URLParameter is more type aware
  • EnvironmentKey is more type aware
  • Supports OPTIONS method and CORS

Meridian

Meridian is a web server written in Swift that lets you write your endpoints in a declarative way.

Here is an example endpoint:

extension URLParameters {
    static let id = URLParameter()
}

struct SampleEndpoint: Route {
  
    static let path: RouteMatcher = "/api/users/\(\.id))/followers"
  
    @QueryParameter("sort_direction") var sortDirection: SortDirection
  
    @URLParameter(\.id) var userID
    
    @EnivronmentObject var database: Database
    
    func body() throws {
        JSON(database.fetchFollowers(of: userID, sortDirection: sortDirection))
    }
  
}

Description

  • Swift Tools 5.2.0
View More Packages from this Author

Dependencies

Last updated: Wed Nov 13 2024 04:33:44 GMT-1000 (Hawaii-Aleutian Standard Time)