Created
February 18, 2015 12:31
-
-
Save hagbarddenstore/2bae55a05f2b2d2065ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Company.ExampleApp | |
{ | |
using System; | |
public class Program | |
{ | |
public static void Main(string[] arguments) | |
{ | |
var router = new Router(); | |
router.Handle("/api/v1/users", ListUsers).Methods(HttpMethods.Get); | |
router.Handle("/api/v1/users", CreateUser).Methods(HttpMethods.Post); | |
router.Handle("/api/v1/users/{userId}", ViewUser).Methods(HttpMethods.Get); | |
router.Handle("/api/v1/users/{userId}", UpdateUser).Methods(HttpMethods.Patch); | |
router.Handle("/api/v1/users/{userId}", DeleteUser).Methods(HttpMethods.Delete); | |
Server.ListenAndServe("http://+:8080/", router); | |
Console.WriteLine("Press enter to exit..."); | |
Console.ReadLine(); | |
Server.Stop("http://+:8080/"); | |
} | |
private static void ListUsers(ResponseWriter response, Request request) | |
{ | |
} | |
private static void CreateUser(ResponseWriter response, Request request) | |
{ | |
} | |
private static void ViewUser(ResponseWriter response, Request request) | |
{ | |
} | |
private static void UpdateUser(ResponseWriter response, Request request) | |
{ | |
} | |
private static void DeleteUser(ResponseWriter response, Request request) | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment