• Stars
    star
    316
  • Rank 132,587 (Top 3 %)
  • Language
    Swift
  • License
    MIT License
  • Created about 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Meridian

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

Here is an example endpoint:

struct SampleEndpoint: Responder {
  
    @QueryParameter("sort_direction") var sortDirection: SortDirection = .ascending
  
    @URLParameter(\.id) var userID
    
    @EnvironmentObject var database: Database
    
    func body() throws {
        JSON(database.fetchFollowers(of: userID, sortDirection: sortDirection))
    }
  
}

Server(errorRenderer: BasicErrorRenderer())
    .register {
        SampleEndpoint()
            .on("/api/users/\(\.id))/followers")

    }
    .environmentObject(Database())
    .listen()

Installation

Meridian uses Swift Package Manager for installation.

Add Meridian as a dependency for your package:

.package(url: "https://github.com/khanlou/Meridian.git", from: "0.0.6"),

The version should be the latest tag on GitHub.

Add Meridian as a dependency for your target as well:

.product(name: "Meridian", package: "Meridian"),

Documentation

Full documentation can be found in the Documentation folder.

More Repositories

1

SKBounceAnimation

A CAKeyframeAnimation subclass that lets you quickly and easily set a number of bounces, and start and end values, and creates an animation for you.
Objective-C
927
star
2

Promise

A Promise library for Swift, based partially on Javascript's A+ spec
Swift
622
star
3

Objective-Shorthand

Objective-Shorthand is a set of categories that make long things in Objective-C short. Additions welcome.
Objective-C
360
star
4

InstantCocoa

Instant Cocoa is a framework for making iOS apps.
Objective-C
250
star
5

SKInnerShadowLayer

SKInnerShadowLayer is a CAGradientLayer subclass that adds properties to create an inner shadow on a given layer.
Objective-C
109
star
6

NSArray-LongestCommonSubsequence

This is a category on NSArray that finds the indexes of the longest common subsequence with another array.
Objective-C
73
star
7

swift-sudoku

Swift
40
star
8

NonEmptyArray

An array in Swift that can't be empty
Swift
35
star
9

SchemaSwift

Generate Swift structs from PostgreSQL database schema
Swift
24
star
10

MandrillTransport-CakePHP

This enables using CakeEmail from CakePHP 2.0 with Mandrill.
PHP
19
star
11

SKTabBarController

A clone of UITabBarController to help understand UIViewController containment.
Objective-C
15
star
12

SKNavigationController

A clone of UINavigationController to help understand UIViewController containment.
Objective-C
15
star
13

pepin

JavaScript
12
star
14

SKStateMachine

A simple state machine, written in Objective-C, that uses metaprogramming to define transitions.
Objective-C
12
star
15

ColumnarGroupedTableView

Objective-C
11
star
16

SKReachability

SKReachability is a singleton that gives quick access to information about the connection.
Objective-C
5
star
17

Parser

A small library for parsing JSON in swift
Swift
4
star
18

BigInt

Swift
3
star
19

SwiftgreSQL

A synchronous blocking wrapper around libpq with no dependencies. Forked and modified from `vapor-community/postgresql`.
Swift
3
star
20

FTWStartupLaunch

A drop-in class that lets you set your program to launch at login.
Objective-C
2
star
21

Tablesum

Automatic table footers in pure JavaScript
JavaScript
1
star
22

FTWCache

Dead simple caching for Mac and iOS
Objective-C
1
star