Skip to content
/ Servine Public

HTTP server and Kotlin libraries with _redirects compatibility

License

Notifications You must be signed in to change notification settings

utybo/Servine

Repository files navigation

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
  • servine Local HTTP server with support for _redirects files

CAUTION: All libraries are published on GitLab, 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. 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 🟡 (1) 🟡 (1) 🟡 (1)
Redirections
Rewrites
Shadowing
HTTP Status codes 🟡 (2) 🟡 (2)
Splats 🟡 (4) 🟡 (3) 🟡 (3)
Placeholders 🟡 (4)
Query parameters
Trailing slash handling 🤷‍♂️
Domain-level redirects
Redirect by country/language
Redirect by cookie

✅ 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-ktor

See the module's README file for more information.

servine

See the module's README file for more information.

servine-livereload

See the module's README file for more information.