diff --git a/16-countries-page-from-api/.project b/16-countries-page-from-api/.project new file mode 100644 index 0000000..e69de29 diff --git a/16-countries-page-from-api/build.sbt b/16-countries-page-from-api/build.sbt new file mode 100644 index 0000000..33cf94a --- /dev/null +++ b/16-countries-page-from-api/build.sbt @@ -0,0 +1,14 @@ + +val toolkitV = "0.1.7" +val toolkit = "org.scala-lang" %% "toolkit" % toolkitV +val toolkitTest = "org.scala-lang" %% "toolkit-test" % toolkitV + +val cask = "com.lihaoyi" %% "cask" % "0.9.1" + +ThisBuild / scalaVersion := "3.2.2" +libraryDependencies += cask +libraryDependencies += toolkit +libraryDependencies += (toolkitTest % Test) + +// https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf +libraryDependencies += "org.thymeleaf" % "thymeleaf" % "3.1.2.RELEASE" diff --git a/16-countries-page-from-api/default.nix b/16-countries-page-from-api/default.nix new file mode 100644 index 0000000..1c08b81 --- /dev/null +++ b/16-countries-page-from-api/default.nix @@ -0,0 +1,22 @@ +{ pkgs, lib, sbt-derivation }: +let + pname = "countries-page"; +in { + package = sbt-derivation.lib.mkSbtDerivation { + inherit pkgs pname; + # ...and the rest of the arguments + version = "0.0.1"; + src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; + nativeBuildInputs = [ pkgs.nodePackages.tailwindcss ]; + buildPhase = '' + tailwindcss -i ./src/input.css -o ./src/main/resources/public/output.css + sbt assembly + ''; + installPhase = '' + mkdir -p $out/bin + cp target/scala-*/${pname}-assembly-*.jar $out/bin/${pname}.jar + ''; + + depsSha256 = ""; + }; +} diff --git a/16-countries-page-from-api/project/build.properties b/16-countries-page-from-api/project/build.properties new file mode 100644 index 0000000..40b3b8e --- /dev/null +++ b/16-countries-page-from-api/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.9.0 diff --git a/16-countries-page-from-api/project/plugins.sbt b/16-countries-page-from-api/project/plugins.sbt new file mode 100644 index 0000000..59cd318 --- /dev/null +++ b/16-countries-page-from-api/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("io.spray" % "sbt-revolver" % "0.10.0") diff --git a/16-countries-page-from-api/src/main/resources/templates/lala.html b/16-countries-page-from-api/src/main/resources/templates/lala.html new file mode 100644 index 0000000..874ce66 --- /dev/null +++ b/16-countries-page-from-api/src/main/resources/templates/lala.html @@ -0,0 +1,24 @@ + + +
+ + +