Last active
July 10, 2016 15:54
-
-
Save julien-truffaut/dd51f88445063ae60b029089e1eed7a4 to your computer and use it in GitHub Desktop.
Scalacss issue
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
package foobar.style | |
import scalacss.Defaults._ | |
object ExampleStyle extends StyleSheet.Inline { | |
import dsl._ | |
val ul = style( | |
backgroundColor.blue | |
) | |
} |
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
package foobar.page | |
import foobar.style.ExampleStyle | |
import scalacss.Defaults._ | |
import scalacss.ScalatagsCss._ | |
import scalatags.Text._ | |
import scalatags.Text.all._ | |
import scalatags.Text.tags2.title | |
object Index { | |
val page = | |
html( | |
ExampleStyle.render[TypedTag[String]], | |
title("FooBar"), | |
head(), | |
body( | |
h1("FooBar"), | |
TopNav.page | |
) | |
) | |
} |
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
package foobar | |
import foobar.page.Index | |
import org.http4s.HttpService | |
import org.http4s.MediaType.`text/html` | |
import org.http4s.dsl._ | |
import org.http4s.headers.`Content-Type` | |
import org.http4s.server.ServerApp | |
import org.http4s.server.blaze._ | |
object Server extends ServerApp { | |
val service = HttpService { | |
case GET -> Root => Ok(Index.page.render).withContentType(Some(`Content-Type`(`text/html`))) | |
} | |
def server(args: List[String]) = BlazeBuilder.bindHttp(8080) | |
.mountService(service, "/") | |
.start | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment