Skip to content
websharper-samplesPublic

About

A simple WebSharper-based REST API

Resources

Stars

7 stars

Watchers

4 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

People API

A small CRUD REST API built with WebSharper sitelets on ASP.NET Core. It maintains an in-memory list of people and exposes it over JSON.

This is the back end for the PeopleClient sample — together they form a client/server pair, and the client references this project to share its model (PersonData, EndPoint, ApiEndPoint, …).

This is a server application (a REST API) and therefore is not deployed to GitHub Pages. CI builds it on every push.

Endpoints

Method Route Description
GET /api/people List all people
GET /api/people/{id} Get one person
POST /api/people Create a person (JSON body)
PUT /api/people Update a person (JSON body)
DELETE /api/people/{id} Delete a person

Running locally

Start the API first:

dotnet run --project src

It listens on http://localhost:5585; try http://localhost:5585/api/people.

Then run the PeopleClient sample, which talks to this API.

CORS origins are configured in src/appsettings.json (the client's http://localhost:5479 is included).

Building

dotnet build src/PeopleApi.fsproj -c Release

About

A simple WebSharper-based REST API

Resources

Stars

7 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages