scx567888 / scx

✨ A Web rapid development framework

Home Page:https://scx.cool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scx-logo

CI maven-central code-size issues license

Vert.x Jackson Spring Framework HikariCP FreeMarker Thumbnailator
Jasypt MySQL Connector/J Java Native Access (JNA) 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.common.standard.HttpMethod;
import cool.scx.core.Scx;
import cool.scx.core.ScxModule;
import cool.scx.mvc.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

About

✨ A Web rapid development framework

https://scx.cool

License:MIT License


Languages

Language:Java 99.8%Language:HTML 0.2%Language:CSS 0.0%Language:JavaScript 0.0%