-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
John Ernest Amiscaray edited this page Dec 29, 2024
·
5 revisions
Work In Progress
In this guide, we'll go over how to create a simple Quak Application from scratch so you can get a gist of the typical workflow. For this guide we'll assume that you:
- have an intermediate to advanced understanding of Java
- have a basic understanding of Maven
- have an understanding of REST APIs
First, create a maven project and add quak.core and quak.web as dependencies of the project (refer to the installation guide to help you set this up). Then, create a class called Main like so:
package io.john.amiscaray.test;
import io.john.amiscaray.quak.web.application.WebStarter;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
public class Main {
public static void main(String[] args) throws ExecutionException, InterruptedException, TimeoutException {
WebApplication application = WebStarter.beginWebApplication(Main.class, args)
.get(10, TimeUnit.SECONDS);
application.await();
}
}This starts a new web application and then calls the Application#await method to block while our web application hasn't terminated yet. Within the WebStarted.beginWebApplication method, Quak scans your project for classes (known as controllers) to use to handle HTTP requests.