Updated README.md
Settings moved to settings.json, routes moved to settings.json, mime_type now specifiable for files.
Update README.md
a simple json "API" engine
Routes are in the routes.json file
text, sends res as text
file, sends file content
directory, sends files contents in directory as json
for example:
[
{
"filename": "file1",
"content": "CoolFile"
},
{
"filename": "file2",
"content": "Nice content"
}
]
route
{
"routes": [
// Respond with text
{
"req": "/text",
"type": "text",
"res": "text"
},
// Respond with the content of a file
{
"req": "/index",
"type": "file",
"res": "src/index.lua"
},
// Respond with a json containing file names and content
{
"req": "/src",
"type": "directory",
"res": "src/"
},
// Get the possible routes and their actions
{
"req": "/rg",
"type": "route get"
},
// Refresh the routes file
{
"req": "/rr",
"type": "route refresh"
},
// Optionally specify the mime type of the file
{
"req": "/index_mime",
"type": "file",
"mime": "text/lua",
"res": "src/index.lua"
},
// Optionally give http status code
{
"req": "/500",
"type": "text",
"status": 500,
"res": "oh no"
}
]
}