mirror of
https://github.com/ethauvin/rife2-bld-hello.git
synced 2025-04-28 10:08:13 -07:00
Initial bld bootstrap template
This commit is contained in:
parent
01dc74fdb0
commit
0c13c8b968
30 changed files with 647 additions and 0 deletions
16
src/main/java/hello/AppSite.java
Normal file
16
src/main/java/hello/AppSite.java
Normal file
|
@ -0,0 +1,16 @@
|
|||
package hello;
|
||||
|
||||
import rife.engine.*;
|
||||
|
||||
public class AppSite extends Site {
|
||||
public void setup() {
|
||||
var hello = get("/hello", c -> c.print(c.template("hello")));
|
||||
get("/", c -> c.redirect(hello));
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new Server()
|
||||
.staticResourceBase("src/main/webapp")
|
||||
.start(new AppSite());
|
||||
}
|
||||
}
|
11
src/main/java/hello/AppSiteUber.java
Normal file
11
src/main/java/hello/AppSiteUber.java
Normal file
|
@ -0,0 +1,11 @@
|
|||
package hello;
|
||||
|
||||
import rife.engine.Server;
|
||||
|
||||
public class AppSiteUber extends AppSite {
|
||||
public static void main(String[] args) {
|
||||
new Server()
|
||||
.staticUberJarResourceBase("webapp")
|
||||
.start(new AppSiteUber());
|
||||
}
|
||||
}
|
11
src/main/resources/templates/hello.html
Normal file
11
src/main/resources/templates/hello.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><!--v title-->Hello App<!--/v--></title>
|
||||
<link rel="stylesheet" href="{{v webapp:rootUrl/}}css/style.css?{{v context:paramRandom/}}">
|
||||
</head>
|
||||
<body>
|
||||
<p>Hello World App</p>
|
||||
</body>
|
||||
</html>
|
18
src/main/webapp/WEB-INF/web.xml
Normal file
18
src/main/webapp/WEB-INF/web.xml
Normal file
|
@ -0,0 +1,18 @@
|
|||
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
|
||||
version="4.0">
|
||||
<filter>
|
||||
<filter-name>RIFE2</filter-name>
|
||||
<filter-class>rife.servlet.RifeFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>rifeSiteClass</param-name>
|
||||
<param-value>hello.AppSite</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>RIFE2</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
</web-app>
|
21
src/main/webapp/css/style.css
Normal file
21
src/main/webapp/css/style.css
Normal file
|
@ -0,0 +1,21 @@
|
|||
:root {
|
||||
/* fonts */
|
||||
--main-font: sans-serif;
|
||||
|
||||
/* font sizes */
|
||||
--main-font-size: 18px;
|
||||
|
||||
/* colors */
|
||||
--main-background-color: #0d0d0d;
|
||||
--main-text-color: #d0d0d0;
|
||||
|
||||
/* margins and padding */
|
||||
--content-padding: 2em;
|
||||
}
|
||||
body {
|
||||
background: var(--main-background-color);
|
||||
font-family: var(--main-font);
|
||||
font-style: var(--main-font-size);
|
||||
color: var(--main-text-color);
|
||||
padding: var(--content-padding);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue