-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into update-scala-versions
- Loading branch information
Showing
88 changed files
with
9,338 additions
and
1,348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version = 3.7.14 | ||
version = 3.7.17 | ||
maxColumn = 120 | ||
|
||
align.preset = more | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
id: static-files | ||
title: "Serving Static Files" | ||
sidebar_label: "Static Files" | ||
--- | ||
|
||
```scala mdoc:silent | ||
import zio._ | ||
import zio.http._ | ||
|
||
object StaticFiles extends ZIOAppDefault { | ||
|
||
/** | ||
* Creates an HTTP app that only serves static files from resources via | ||
* "/static". For paths other than the resources directory, see | ||
* [[Middleware.serveDirectory]]. | ||
*/ | ||
val app = Routes.empty.toHttpApp @@ Middleware.serveResources(Path.empty / "static") | ||
|
||
override def run = Server.serve(app).provide(Server.default) | ||
} | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package example | ||
|
||
import zio._ | ||
|
||
import zio.http._ | ||
|
||
object StaticFiles extends ZIOAppDefault { | ||
|
||
/** | ||
* Creates an HTTP app that only serves static files from resources via | ||
* "/static". For paths other than the resources directory, see | ||
* [[Middleware.serveDirectory]]. | ||
*/ | ||
val app = Routes.empty.toHttpApp @@ Middleware.serveResources(Path.empty / "static") | ||
|
||
override def run = Server.serve(app).provide(Server.default) | ||
} |
Oops, something went wrong.