Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/utybo/servine
HTTP server and Kotlin libraries with _redirects compatibility
https://github.com/utybo/servine
kotlin ktor ktor-server redirects
Last synced: 18 days ago
JSON representation
HTTP server and Kotlin libraries with _redirects compatibility
- Host: GitHub
- URL: https://github.com/utybo/servine
- Owner: utybo
- License: mpl-2.0
- Created: 2021-08-07T16:50:05.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-27T21:12:46.000Z (over 2 years ago)
- Last Synced: 2024-10-11T11:22:05.542Z (about 1 month ago)
- Topics: kotlin, ktor, ktor-server, redirects
- Language: JavaScript
- Homepage:
- Size: 193 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# [![Servine](https://img.pokemondb.net/sprites/black-white-2/anim/normal/servine.gif)](http://pokemondb.net/pokedex/servine) Servine
Experimental toolkit for working with `_redirects` file.
* `redirects-parser` Simple parser for `_redirects` files
* `redirects-ktor` Redirection plugin with support for `_redirects` files for [Ktor](https://ktor.io)
* `servine` Local HTTP server with support for `_redirects` files**CAUTION:** All libraries are published on [GitLab](https://gitlab.com/utybo/packages/-/packages?search[]=guru%2Fzoroark%2Fservine), despite a "Packages" section being present on this repository.
> ⚡ This app and its libraries are under heavy development and are not stable yet. Moreover, they should only be used for development purposes only - very little sanity checks are performed.
## Features
The redirection implementation is largely based
on [Netlify's redirection system](https://docs.netlify.com/routing/redirects/). Please file an issue if you notice any
difference between Netlify's behavior and any of the libraries here.Refer to the following for compatibility information
| Feature | `redirects-parser` | `redirects-ktor` | `servine` |
|:-------:|:------------------:|:----------------:|:---------:|
| [`_redirects` files](https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file) | 🟡 (1) | 🟡 (1) | 🟡 (1) |
| Redirections | ✅ | ✅ | ✅ |
| [Rewrites](https://docs.netlify.com/routing/redirects/rewrites-proxies/) | ✅ | ✅ | ✅ |
| [Shadowing](https://docs.netlify.com/routing/redirects/rewrites-proxies/#shadowing) | ❌ | ❌ | ❌ |
| [HTTP Status codes](https://docs.netlify.com/routing/redirects/redirect-options/#http-status-codes) | ✅ | 🟡 (2) | 🟡 (2) |
| [Splats](https://docs.netlify.com/routing/redirects/redirect-options/#splats) | 🟡 (4) | 🟡 (3) | 🟡 (3) |
| [Placeholders](https://docs.netlify.com/routing/redirects/redirect-options/#placeholders) | 🟡 (4) | ❌ | ❌ |
| [Query parameters](https://docs.netlify.com/routing/redirects/redirect-options/#query-parameters) | ❌ | ❌ | ❌ |
| [Trailing slash handling](https://docs.netlify.com/routing/redirects/redirect-options/#trailing-slash) | 🤷♂️ | ❌ | ❌ |
| [Domain-level redirects](https://docs.netlify.com/routing/redirects/redirect-options/#domain-level-redirects) | ❌ | ❌ | ❌ |
| [Redirect by country/language](https://docs.netlify.com/routing/redirects/redirect-options/#redirect-by-country-or-language) | ❌ | ❌ | ❌ |
| [Redirect by cookie](https://docs.netlify.com/routing/redirects/redirect-options/#redirect-by-cookie-presence) | ❌ | ❌ | ❌ |✅ Fully supported | 🔧 Can be optionally enabled | 🟡 Partially supported | ❌ Not supported | 🤷♂️ Not applicable
1. These files can be parsed, but not all features are supported -- refer to the table to know which ones are.
2. Only status codes 302, 301, 404 and 200 are supported.
3. The post-url `*` is supported, but the `:splat` placeholder is not, nor is `*` anywhere except at the end of the URL.
4. Parsed as a regular string -- not exposed in any particular way. This is not actively tested and will be at a later date.## `redirects-parser`
[See the module's README file for more information.](redirects-parser/README.md)
## `redirects-ktor`
[See the module's README file for more information.](redirects-ktor/README.md)
## `servine`
[See the module's README file for more information.](servine/README.md)
## `servine-livereload`
[See the module's README file for more information.](servine-livereload/README.md)