Created
July 11, 2015 07:30
-
-
Save avisagie/aceba5b022a2dc022197 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package asv.tryspark; | |
import com.google.gson.Gson; | |
import static spark.Spark.*; | |
/** | |
* Created by albert on 2015/07/11. | |
*/ | |
public class Main { | |
public static class Result { | |
public final String contents; | |
public Result(String contents) { | |
this.contents = contents; | |
} | |
} | |
public static void main(String[] args) { | |
Gson gson = new Gson(); | |
get("/", "application/json", (req, res) -> { | |
return new Result("Hello world!"); | |
}, gson::toJson); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment