Krin is a simple server that host files and pictures for sharing instantaneously with your collegues or your friends built in NodeJS and SQLite. It can be used by multiple users by creating new API key for each person.
You only need to have Node.JS installed on your machine.
WIP
WIP
Headers:
X-Api-Key
: user's api key- (optionnal)
Content-type
: return the error message in JSON if the value isapplication/json
, otherwise is return in plain text.
Return: Return the link to the file.
Headers:
X-Api-Key
: user's api key- (optionnal)
Expires-At
: expiration date of the ressource inRFC2822
orISO8601
format.
Return: Return the list of user's files.
Headers:
- (optionnal)
Content-type
: return the error message in JSON if the value isapplication/json
, otherwise is return in plain text.
Return: Return the requested file or error message.
Headers:
X-Api-Key
: user's api key- (optionnal)
Content-type
: return the error message in JSON if the value isapplication/json
, otherwise is return in plain text.
Return: Return validation message or error message.
curl -H "X-Api-Key: <my_api_key>" https://<link_to_my_instance>/files
Return:
[
{
"uuid": "2bfe71af-3ca5-4c2b-a148-da1eb1b88b36",
"file": "2732b422634229d30187ea25a930af13.jpg",
"owner": "4faa8b88-d63b-11e8-9f8b-f2801f1b9fd1",
"expireAt": null,
"createdAt": "2018-10-31 08:07:22.760 +00:00",
"updatedAt": "2018-10-31 08:07:22.760 +00:00"
},
...
]
curl -X POST -H "X-Api-Key: <my_api_key>" -d @<file> https://<link_to_my_instance>/files
Return: https://<link_to_my_instance>/files/fkjldsjlkdsjklsdjflkdsjklsdjfs
curl -X POST -H "X-Api-Key: <my_api_key>" -H "Content-type: application/json" -d @<file> https://<link_to_my_instance>/files
Return:
{
"code": 200,
"message": "https://<link_to_my_instance>/files/fkjldsjlkdsjklsdjflkdsjklsdjfs"
}
curl -X POST -H "X-Api-Key: <my_api_key>" -H "Expires-At: Mon, Dec 24 2018 23:59:59 GMT" -d @<file> https://<link_to_my_instance>/files
Return: https://<link_to_my_instance>/files/enzjrkzenrezkjrnezjknrzjke
curl -X DELETE -H "X-Api-Key: <my_api_key>" https://<link_to_my_instance>/files/<file_name>
Return: File deleted
curl -X DELETE -H "X-Api-Key: <my_api_key>" -H "Content-type: application/json" -d @<file> https://<link_to_my_instance>/files/<file_name>
Return:
{
"code": 200,
"message": "File deleted"
}
WIP
Today, Krin uses file-type module to determine the MIME type and the extension of the file. If is not recognized by the module, it fallback automaticaly to application/octet-stream.
Feel free to contribute to the project by creating issues or merge request for implementing new features or patch bug.
Krin is released with MIT License.