Table of Contents

CORS 🔗

By default, Sharaf sets no permitted origins.
This means you can only use the API/website from the same domain.

If you want it to be available for other domains, use the corsSettings parameter to set desired config:

            val corsSettings = CorsSettings.default.withAllowedOrigins(Set("https://example.com"))

val server = UndertowSharafServer(
    "localhost",
    port,
    routes,
    corsSettings = corsSettings
  )