Live data from Hacker News

Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

javalin.io

31–40 of 139 posts

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#31

this is very cool. quick question though - do u have a gradle build setup ? im new to java and saw this problem on spring boot. That you needed to have this bunch of complex directory structures cos of the way java packages worked. for e.g. the test directories were parallel to the src directory, so they could be named with the same package name. for a single file...i can just run java. but it would be nice to see a…

I'm not super sure what you're asking, but Javalin doesn't care at all about your directory structure. You can add it as a dependency to any existing gradle project you have, and import it like any other Java library (like java.lang.String).

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#33

I just wanted to say thank you for your work. The straightforward docs are some the best in my opinion when you want to go from "How do I do ..." to answer. I ended up using Javalin with Kotlin and SQLite to build my wedding website. Most of my projects are lucky to see the light of day, but with a very persistent project manager and a simple lightweight framework, I was able to ship a fantastic product with very lit…

Hey, thank you for using it. Single-page docs are also my favorite, and Javalin/jdbi/SQLite is my goto for quick stuff!

> but with a very persistent project manager

Your partner? :D

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#34

I successfully used Javalin in a project using Kotlin + Koin for dependency injection + jOOQ for database access. Was a joy to setup and work in that project. Thank you! Congratulations on the major release and keep up the good work.

JDBI also could be really nice as a minimalistic layer for a db access

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#36
post #14

I find that hello world example very pleasant to look at. Love that it's effectively a one-liner. public static void main(String[] args) { var app = Javalin.create(/*config*/) .get("/", ctx -> ctx.result("Hello World")) .start(7070); }

Looks very similar to Express.js which came out in 2011 and has been one of the most popular frameworks in the Node.js world.

https://expressjs.com/en/starter/hello-world.html

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#38
post #30
post #10

Earlier quoted context omitted.

Seems to compile fine here, what's the issue? Edit: I was looking at the wrong snippet, the offending snippet has been fixed.

Huh, I wonder what's different with my setup. I would need to put curly braces around that closure before it would compile, i.e: .get("/", { ctx -> ctx.result("Hello World") }) Closures defined only by the arrow are a Java thing... or so I thought. :D

> Closures defined only by the arrow are a Java thing... or so I thought. :D

In fairness, I think you did copy the Java version. There's a little switch in the code boxes where you can toggle the language, if you switch to Kotlin you get the version with trailing closures :)

Edit: I'm an idiot, I see the snippet you mean now. It's been updated now, give it a minute.

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#39
post #10

Earlier quoted context omitted.

Seems to compile fine here, what's the issue? Edit: I was looking at the wrong snippet, the offending snippet has been fixed.

Probably not used to seeing lambdas inside of parens: .get("/", ctx -> ctx.result("Hello World")) Could also be written as .get("/") { ctx -> ctx.result("Hello World") } The second form seems much more common in Kotlin.

Yeah, no, he was 100% correct, I was just looking at the wrong snippet. It's been fixed now :)

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#40
post #38
post #30

Earlier quoted context omitted.

Huh, I wonder what's different with my setup. I would need to put curly braces around that closure before it would compile, i.e: .get("/", { ctx -> ctx.result("Hello World") }) Closures defined only by the arrow are a Java thing... or so I thought. :D

> Closures defined only by the arrow are a Java thing... or so I thought. :D In fairness, I think you did copy the Java version. There's a little switch in the code boxes where you can toggle the language, if you switch to Kotlin you get the version with trailing closures :) Edit: I'm an idiot, I see the snippet you mean now. It's been updated now, give it a minute.

Sweet, thanks!
Post reply on HN