Skip to content
/ scx Public

✨ A Web rapid development framework

License

Notifications You must be signed in to change notification settings

scx567888/scx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scx-logo

CI maven-central code-size issues license

Helidon Jackson Spring Framework HikariCP FreeMarker Thumbnailator
Jasypt MySQL Connector/J Cron utils SLF4J Apache Log4j 2 TestNG

English | 简体中文

A Web rapid development framework

Maven

<dependency>
    <groupId>cool.scx</groupId>
    <artifactId>scx-core</artifactId>
    <version>{version}</version>
</dependency>

Quick start

1. Write your own module and run the main method .

import cool.scx.core.Scx;
import cool.scx.core.ScxModule;
import cool.scx.http.HttpMethod;
import cool.scx.web.annotation.ScxRoute;

// Note : Custom modules need extends ScxModule
// This @ScxRoute indicate this class needs to be scanned by WebHandler
@ScxRoute
public class YourModule extends ScxModule {

    public static void main(String[] args) {
        // Use Scx Builder, build and run project
        Scx.builder()
                .setMainClass(YourModule.class) // 1, The class of the Main method
                .addModule(new YourModule())    // 2, Your own modules
                .setArgs(args)                  // 3, External parameters
                .run();                         // 4, Build and run project
    }

    // This @ScxRoute indicate this method is a WebHandler 
    // The path is "" and the request method is GET
    @ScxRoute(value = "", methods = HttpMethod.GET)
    public String helloWorld() {
        // The content that will be sent to the client 
        return "Hello World";
    }

}

2. Use your browser to access http://localhost:8080/ , you should see this .

Hello World

For more information, see docs

Stats

Alt