https://github.com/x4e/ktor-sharex
ShareX in Kotlin using Ktor
https://github.com/x4e/ktor-sharex
Last synced: 9 months ago
JSON representation
ShareX in Kotlin using Ktor
- Host: GitHub
- URL: https://github.com/x4e/ktor-sharex
- Owner: x4e
- License: mit
- Created: 2020-03-09T15:56:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-10T10:07:35.000Z (over 6 years ago)
- Last Synced: 2025-03-11T22:34:27.017Z (over 1 year ago)
- Language: Kotlin
- Size: 9.77 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ktor ShareX
ShareX in Kotlin using Ktor
## Usage
```Kotlin
fun Application.module() {
install(ShareX) {
token = "verysecrettokenhere"
}
route("sharex") {
shareXUpload("upload")
shareXHost("get")
}
host(Regex("i\\..+")) {
shareXHost()
}
}
```
This will create an upload endpoint at example.com/sharex/upload, and hosting endpoints at both example.com/sharex/get and i.example.com
ShareX config:
```Json
{
"Version": "12.4.1",
"Name": "KtorShareX",
"DestinationType": "ImageUploader, TextUploader, FileUploader",
"RequestMethod": "POST",
"RequestURL": "https://[websiteURL]/sharex/upload",
"Body": "MultipartFormData",
"Arguments": {
"token": "verysecrettokenhere"
},
"FileFormName": "file",
"URL": "https://i.[websiteURL]/$response$"
}
```