Skip to content

Instantly share code, notes, and snippets.

@tsega
Created December 27, 2019 11:54
Show Gist options
  • Save tsega/b15307af018d49171dfdbde47f0d2d07 to your computer and use it in GitHub Desktop.
Save tsega/b15307af018d49171dfdbde47f0d2d07 to your computer and use it in GitHub Desktop.
Rest-a-culous - https://github.com/tsega/restaculous, sample settings file
{
"name": "Movies",
"description": "A REST API endpoint for a Movie streaming app.",
"author": "Tsegaselassie Tadesse <tsegaselassi@gmail.com>",
"directory": "./movies-api-tmp",
"repository": {
"type": "git",
"url": "http://git.gebeya.com/tsega/movie-api.git"
},
"config": [
{"name": "HTTP_PORT", "value":"process.env.HTTP_PORT || 8000", "comment": "HTTP PORT"},
{"name": "MONGODB_URL", "value":"'mongodb://localhost/movies'", "comment": "Mongodb URL"},
{"name": "SALT_LENGTH", "value":"13", "comment": "SALT VALUE LENGTH"},
{"name": "TOKEN_LENGTH", "value":"253", "comment": "TOKEN LENGTH"},
{"name": "MAX_PAGE_SIZE", "value":"100", "comment": "DEFAULT PAGE SIZE"},
{"name": "DEFAULT_SORT", "value":"'updatedAt'", "comment": "DEFAULT SORT FIELD"}
],
"models": [
{
"name": "Movie",
"attributes": [
{
"name": "title",
"type": "String",
"desc": "The title of the movie.",
"example": "Forest Gump",
"validation": [
{ "type": "isEmpty", "message": "Title is required." }
]
},
{
"name": "genre",
"type": "String",
"desc": "The category of the movie.",
"example": "Action",
"isPrivate": true
}
],
"relations": [{
"name": "Actor",
"referenceType": "multiple"
}]
},
{
"name": "Actor",
"attributes": [
{
"name": "firstName",
"type": "String",
"desc": "The first name of the actor.",
"example": "Tom",
"validation": [
{ "type": "isEmpty", "message": "First Name is required." }
]
},
{
"name": "lastName",
"type": "String",
"desc": "The last name of the actor.",
"example": "Hanks",
"validation": [
{ "type": "isEmpty", "message": "Last Name is required." }
]
}
],
"relations": [{
"name": "Movie",
"referenceType": "multiple"
}]
},
{
"name": "Playlist",
"attributes": [
{
"name": "name",
"type": "String",
"desc": "The name of the playlist.",
"example": "Classic Movies",
"validation": [
{ "type": "isEmpty", "message": "Name is required." }
]
}
],
"relations": [{
"name": "Movie",
"referenceType": "multiple"
}]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment