Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/obj
/bin
101 changes: 101 additions & 0 deletions GiraffeSample.postman_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"variables": [],
"info": {
"name": "Giraffe",
"_postman_id": "9e443bce-0899-ea76-03cb-7c9faef23c65",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
"name": "localhost:5000/lunch?cuisine=Italian",
"request": {
"url": {
"raw": "localhost:5000/lunch?cuisine=Italian",
"host": [
"localhost"
],
"port": "5000",
"path": [
"lunch"
],
"query": [
{
"key": "cuisine",
"value": "Italian",
"equals": true,
"description": ""
}
],
"variable": []
},
"method": "GET",
"header": [],
"body": {},
"description": ""
},
"response": [
{
"id": "8ffbfbb0-8f62-4dec-b1dd-27fe228e85ff",
"name": "localhost:5000/lunch?cuisine=Italian",
"originalRequest": {
"url": "localhost:5000/lunch/add",
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"Name\": \"Pizza Pazza\",\n \"Latitude\": 47.619309,\n \"Longitude\": -122.131438,\n \"Cuisine\": \"Italian\",\n \"VegetarianOptions\": true,\n \"VeganOptions\": true\n }"
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "plainText",
"_postman_previewtype": "text",
"header": [
{
"name": "content-length",
"key": "content-length",
"value": "37",
"description": "The length of the response body in octets (8-bit bytes)"
},
{
"name": "content-type",
"key": "content-type",
"value": "text/plain",
"description": "The mime type of this content"
},
{
"name": "date",
"key": "date",
"value": "Tue, 17 Oct 2017 19:23:57 GMT",
"description": "The date and time that the message was sent"
},
{
"name": "server",
"key": "server",
"value": "Kestrel",
"description": "A name for the server"
}
],
"cookie": [],
"responseTime": 82,
"body": "Added Pizza Pazza to the lunch spots."
}
]
},
{
"name": "localhost:5000/lunch/add",
"request": {
"url": "localhost:5000/lunch/add",
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"Name\": \"Pizza Pazza\",\n \"Latitude\": 47.619309,\n \"Longitude\": -122.131438,\n \"Cuisine\": \"Italian\",\n \"VegetarianOptions\": true,\n \"VeganOptions\": true\n }"
},
"description": ""
},
"response": []
}
]
}
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,41 @@ This sample app demonstrates F#, .NET Core, Giraffe, and using Sqlite. You can d
3. Run `dotnet restore` before opening the project in VSCode.
4. Use `dotnet watch run` for development. It'll recompile and re-run the project when you make changes.

## Routes

### GET /lunch?cuisine=Italian
`RESPONSE:`
```json
[
{
"ID": 4,
"Name": "Tutta Bella Neapolitan Pizzeria",
"Latitude": 47.619309,
"Longitude": -122.131438,
"Cuisine": "Italian",
"VegetarianOptions": true,
"VeganOptions": true
}
]
```

### POST /lunch/add
`BODY:`
```json
{
"Name": "Pizza Pazza",
"Latitude": 47.619309,
"Longitude": -122.131438,
"Cuisine": "Italian",
"VegetarianOptions": true,
"VeganOptions": true
}
```
`RESPONSE:`
`Added Pizza Pazza to the lunch spots.`

I recommend using [Postman](https://www.getpostman.com/) to play around with it.
You can import a collection with the two [requests](GiraffeSample.postman_collection.json)

## Deployment

Expand Down