Skip to content

Latest commit

 

History

99 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yet Another Web Library (framework?)

Disclaimer: This is a personal hobby project and is not intended for production use.
I am developing my own web framework entirely from scratch, without any external assistance.
With 11+ years of experience using Spring and Spring Boot, I have undoubtedly drawn some inspiration from them.
However, while certain aspects may appear similar, all code has been written independently by me.

Installation (maven)

<dependency>
    <groupId>io.github.maximevdk</groupId>
    <artifactId>yawl</artifactId>
    <version>0.0.6</version>
</dependency>

Building an executable jar

<plugin>
    <groupId>io.github.maximevdk</groupId>
    <artifactId>yawl-maven-plugin</artifactId>
    <version>0.0.3</version>
    <executions>
        <execution>
            <goals>
                <goal>compile</goal>
                <goal>package</goal>
            </goals>
        </execution>
    </executions>
</plugin>

optionally you can provide a main class in case you have more than one on the classpath.

<configuration>
    <mainClass>com.example.MainClass</mainClass>
</configuration>

Usage

Creating a new runnable application

public class Application {
    public static void main(String[] args) {
        YawlApplication.run(Application.class, args);
    }
}

Creating a controller

import com.yawl.annotations.GetMapping;
import com.yawl.annotations.WebController;

@WebController(path = "ping")
public class PingController {

    @GetMapping
    public String ping() {
        return "pong";
    }  
    
    @GetMapping("/{id}")
    public String pingById(@PathParam(name = "id") String id) {
        return "pong";
    }
}

Creating a bean

Using @Service annotation

import com.yawl.annotations.GetMapping;
import com.yawl.annotations.Service;

@Service
public class PingService {
    public String ping() {
        return "pong";
    }
}

Using a configuration class

@Configuration
public class ApplicationConfiguration {
    @Bean(name = "pongDatabase")
    public InMemoryDatabase<String, Pong> pongDatabase() {
        return new InMemoryDatabase<>() {};
    }
}

About

Yet another web library (framework?)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages