Giter Site home page Giter Site logo

alsnrbernardo / fsharp-web-server-showcase Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 25 KB

POC API based on F# and the Saturn Framework.

F# 98.18% Shell 1.82%
dbup dotnet6 fsharp fsharp-samples safe-stack saturn-framework sqlprovider query-expessions giraffe npgsql

fsharp-web-server-showcase's Introduction

Scoring-API

POC API for scoring CPFs based on F# (Dotnet 6) and the Saturn Framework.

Frameworks/Libraries

Setting the application up (from scratch)

docker run --name db-pgsql -e POSTGRES_PASSWORD=passw0rd -p 5432:5432 -d postgres
git clone https://github.com/alsnrbernardo/score-api.git && cd score-api
  • Set up the dependencies
dotnet tool restore && dotnet paket install
  • Build the solution
dotnet build .
  • Perform database migration (depends on Postgres container)
dotnet run --project src/Migrations
dotnet run --project src/Scoring-API

Testing

API endpoints:

  • GET /health check if the server is running.
curl --request GET \
--url http://localhost:8085/health
  • GET /score/<CPF> fetches the values and creation dates of scores attributed to the given CPF.
curl --request GET \
--url http://localhost:8085/score/xxxxxxxxxxx \
--header 'Content-Type: application/json'
  • POST /score scores and registers the provided CPF
curl --request POST \
--url http://localhost:8085/score \
--header 'Content-Type: application/json' \
--data '{ "cpf": "xxxxxxxxxxx" }}'

fsharp-web-server-showcase's People

Contributors

alsnrbernardo avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.