You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
10 years ago | |
|---|---|---|
| app | 10 years ago | |
| bin | 10 years ago | |
| config | 10 years ago | |
| db | 10 years ago | |
| lib | 10 years ago | |
| log | 10 years ago | |
| public | 10 years ago | |
| test | 10 years ago | |
| vendor/assets | 10 years ago | |
| .gitignore | 10 years ago | |
| Gemfile | 10 years ago | |
| Gemfile.lock | 10 years ago | |
| README.md | 10 years ago | |
| Rakefile | 10 years ago | |
| config.ru | 10 years ago | |
README.md
API Docs
Classical
User + Session are all done the 'old fashioned way' via server-rendered erb.
ROOT (/): Renders the Sign In / Sign Up forms. POST /users will create a new user, redirect to ROOT POST /session will create a new session, redirect to SPA page
JSON
GET /session will return JSON object containing currently logged in user
GET /transgressions will return array of transgressions complete with confessions subarray
```json
{
transgressions: [
{
id: 3,
sin_type: "Gluttony",
description: "I love eating a whole box full of cucumbers, like a 20lb box"
confessions: [
{
description: "Some description",
occurred_at: "3 weeks ago"
}
]
}
]
}
```
POST /transgressions will take a JSON object as such:
```json
{
authenticity_token: "osmeaksdfiohuiHDFIUSDHFUkjadfhjk324",
transgression: {
sin_type: "Some Sin",
description: "Some Description"
}
}
```
And return the created transgression as an object.
POST /transgressions/:id/confessions will take a JSON object as such:
```json
{
authenticity_token: "adsf123i478KJkhajksldfhjk0",
confession: {
description: "I did a thing",
occurred_at: "2015-03-27"
}
}
```