Closed kellyi closed 6 years ago
We'll need to update the README at some point, but I'm not sure what that point is. I'm happy to make some small changes here if we'd like.
I made #56 for updating the README. I think we should do it after the dust has settled.
Going to add a commit to incorporate some of the work on this branch:
Pushed a few new commits which...
update
and server
scripts to specify "project api"HttpApp
:LazyLogging
trait to the server:object WebServer extends HttpApp with App with LazyLogging
/run
to serialize a Scala map to JSON for the outputI made #55 to handle updating the build.scala
file to build.sbt
, as it seems like this will be involved enough to merit more investigation & review
These changes now also add setup
, update
, and console
scripts with minimal implementations.
Taking another look.
Thanks for all your help with this! I squashed everything down to a single commit. Going to double check that everything still works as expected then merge.
Overview
This PR adds an Akka HTTP server to the repo as a separate project. The server lives in
api/src/main/scala/WebServer.scala
and it's currently got two endpoints:GET :8090/ping
which returnspong
POST :8090/run
which accepts a string, prints it to the log, then returns a hard coded heredoc-type string representing the expected output.I also added two short scripts:
build
, which runs./sbt assembly
anddebugserver
which runs./sbt ~re-start
.The latter watches the file system for changes & recompiles when it sees them and it should shorten the development loop, since we'll no longer have to create a jar file to test each change. However, it currently only works with the
WebServer
because it expects there to be some sort of Main class in each project -- and we don't currently have one in thesummary
dir.One solution to this would be to just put the server in the same dir and the job files be siblings. Since there's only a single file for the server, it wouldn't clutter up the namespace too much.
Connects #48 Connects #50
Testing
./sbt compile
./scripts/debugserver
and verify that the server startshttp POST :8090/run hello=world
and verify that you: a) get the hard-coded output back and b) can see{hello: "world"}
in the server loghttp :8090/ping
and verify that you see a pongping
endpoint such that it concludes withcomplete("hello world")
, then save the file. Verify that the project's recompiled and that you canhttp :8090/ping
to see the new output