This guide will get you started using Spark on Heroku/Cedar. Spark is basically a clone of Sinatra for Java. 'Nuff said.
Create a single Java main class in src/main/java/HelloWorld.java:
import static spark.Spark.*;
import spark.*;| window.onload = function() { | |
| var v0 = new Vertex("0"); | |
| var v1 = new Vertex("1"); | |
| var v2 = new Vertex("2"); | |
| var v3 = new Vertex("3"); | |
| var v4 = new Vertex("4"); | |
| var v5 = new Vertex("5"); | |
| var v6 = new Vertex("6"); | |
| var v7 = new Vertex("7"); |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Note: If you want to use your personal Twitter account to post commits, go to Step 2
| /* | |
| * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. | |
| * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. | |
| * | |
| * | |
| * | |
| * | |
| * | |
| * | |
| * |
| package statemachine | |
| import debug | |
| import fail | |
| import io.reactivex.Observable | |
| import kotlinx.coroutines.experimental.channels.Channel | |
| import kotlinx.coroutines.experimental.channels.produce | |
| import kotlinx.coroutines.experimental.delay | |
| import kotlinx.coroutines.experimental.launch | |
| import kotlinx.coroutines.experimental.runBlocking |
| buildscript { | |
| ext { | |
| kotlinVersion = "1.2.21" | |
| springBootVersion = "1.5.10.RELEASE" | |
| javafxGradlePluginVersion = "8.8.0" | |
| } | |
| repositories { | |
| mavenCentral() | |
| } | |
| dependencies { |