Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Basic web app. Broken logging |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | descendants | main | trunk |
Files: | files | file ages | folders |
SHA3-256: |
16f294f2fe25fd62676c8eb1b7297dde |
User & Date: | stephen@calmabiding.me 2021-03-15 20:11:41 |
Context
2021-03-15
| ||
20:28 | Web test! check-in: cd4b2133e4 user: stephen@calmabiding.me tags: main, trunk | |
20:11 | Basic web app. Broken logging check-in: 16f294f2fe user: stephen@calmabiding.me tags: main, trunk | |
Changes
Added .gitignore.
> > | 1 2 | *.iml .idea |
Added pom.xml.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>me.calmabiding</groupId> <artifactId>coffeetime</artifactId> <version>1.0-SNAPSHOT</version> <name>coffeetime</name> <!-- FIXME change it to the project's website --> <url>http://www.example.com</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-engine</artifactId> <version>5.4.0</version> <scope>test</scope> </dependency> <dependency> <groupId>com.sparkjava</groupId> <artifactId>spark-core</artifactId> <version>2.9.3</version> </dependency> <dependency> <groupId>com.google.inject</groupId> <artifactId>guice</artifactId> <version>5.0.1</version> </dependency> </dependencies> <build> <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> <plugins> <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> <plugin> <artifactId>maven-clean-plugin</artifactId> <version>3.1.0</version> </plugin> <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> <plugin> <artifactId>maven-resources-plugin</artifactId> <version>3.0.2</version> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.1</version> </plugin> <plugin> <artifactId>maven-jar-plugin</artifactId> <version>3.0.2</version> </plugin> <plugin> <artifactId>maven-install-plugin</artifactId> <version>2.5.2</version> </plugin> <plugin> <artifactId>maven-deploy-plugin</artifactId> <version>2.8.2</version> </plugin> <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> <plugin> <artifactId>maven-site-plugin</artifactId> <version>3.7.1</version> </plugin> <plugin> <artifactId>maven-project-info-reports-plugin</artifactId> <version>3.0.0</version> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>11</source> <target>11</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <dependencies> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-engine</artifactId> <version>5.6.2</version> </dependency> </dependencies> </plugin> </plugins> </pluginManagement> </build> </project> |
Added src/main/java/me/calmabiding/App.java.
> > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | package me.calmabiding; import com.google.inject.Guice; import com.google.inject.Injector; /** * Hello world! */ public class App { public static void main(String[] args) { final Injector injector = Guice.createInjector(new CoffeeTimeProvider()); injector.getInstance(WebInterface.class).start(); } } |
Added src/main/java/me/calmabiding/CoffeeTimeProvider.java.
> > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 | package me.calmabiding; import com.google.inject.AbstractModule; public class CoffeeTimeProvider extends AbstractModule { @Override protected void configure() { bind(WebInterface.class).toInstance(WebInterface.spark()); } } |
Added src/main/java/me/calmabiding/WebInterface.java.
> > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | package me.calmabiding; import static spark.Spark.*; public interface WebInterface { static WebInterface spark() { return new WebInterface() { @Override public void start() { port(3000); get("/hello", (req, res) -> "Hello World"); System.out.println("Starting"); } @Override public void stop() { System.out.println("Stopping"); } }; } void start(); void stop(); } |
Added src/test/java/me/calmabiding/AppTest.java.
> > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | package me.calmabiding; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertTrue; /** * Unit test for simple App. */ public class AppTest { /** * Rigorous Test :-) */ @Test public void shouldAnswerWithTrue() { assertTrue(true); } } |