-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'nob/updates' into 'main'
Updating dependencies, Restructure Exporter See merge request reactivecore/kreuzberg!54
- Loading branch information
Showing
13 changed files
with
98 additions
and
94 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
16 changes: 16 additions & 0 deletions
16
examples/jvm/src/main/scala/kreuzberg/examples/showcase/DeploymentConfig.scala
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,16 @@ | ||
package kreuzberg.examples.showcase | ||
|
||
import kreuzberg.examples.showcase.todo.TodoApi | ||
import kreuzberg.miniserver.{AssetCandidatePath, AssetPaths, DeploymentConfig, MiniServerConfig} | ||
import kreuzberg.rpc.{Dispatcher, SecurityError} | ||
import zio.ZIO | ||
|
||
val deploymentConfig = DeploymentConfig( | ||
AssetPaths( | ||
Seq( | ||
AssetCandidatePath("examples/js/target/client_bundle/client/fast"), | ||
AssetCandidatePath("../examples/js/target/client_bundle/client/fast"), | ||
AssetCandidatePath("../../examples/js/target/client_bundle/client/fast") | ||
) | ||
) | ||
) |
3 changes: 3 additions & 0 deletions
3
examples/jvm/src/main/scala/kreuzberg/examples/showcase/Exporter.scala
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,3 @@ | ||
package kreuzberg.examples.showcase | ||
|
||
object Exporter extends kreuzberg.miniserver.Exporter(deploymentConfig) |
20 changes: 20 additions & 0 deletions
20
examples/jvm/src/main/scala/kreuzberg/examples/showcase/Main.scala
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,20 @@ | ||
package kreuzberg.examples.showcase | ||
|
||
import scala.annotation.experimental | ||
|
||
@experimental | ||
object Main { | ||
def main(args: Array[String]): Unit = { | ||
args.headOption match { | ||
case None => | ||
println("Expected command") | ||
System.exit(1) | ||
case Some("serve") => ServerMain.main(args.tail) | ||
case Some("serveLoom") => ServerMainLoom.main(args.tail) | ||
case Some("export") => Exporter.main(args.tail) | ||
case Some(other) => | ||
println("Undefined command") | ||
System.exit(1) | ||
} | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
miniserver-common/src/main/scala/kreuzberg/miniserver/DeploymentConfig.scala
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,22 @@ | ||
package kreuzberg.miniserver | ||
|
||
import kreuzberg.Html | ||
import kreuzberg.miniserver.{AssetPaths, DeploymentType} | ||
|
||
/** Deployment related configuration */ | ||
case class DeploymentConfig( | ||
assetPaths: AssetPaths, | ||
extraJs: Seq[String] = Nil, | ||
extraCss: Seq[String] = Nil, | ||
extraHtmlHeader: Seq[Html] = Nil, | ||
deploymentType: Option[DeploymentType] = None, | ||
produktionBlacklist: Seq[String] = Seq( | ||
".*\\.js\\.map", | ||
".*\\.css\\.map" | ||
), | ||
noScriptText: Option[String] = None // if not given, use default. | ||
) { | ||
def hashedUrl(name: String): String = assetPaths.hashedUrl(name, deploymentType) | ||
|
||
def locateAsset(name: String): Option[Location] = assetPaths.locateAsset(name: String, deploymentType) | ||
} |
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
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