Home

Awesome

<p align="center"> <img src="https://scx.cool/logos/scx-logo.svg" width="300px" alt="scx-logo"/> </p> <p align="center"> <a target="_blank" href="https://github.com/scx567888/scx/actions/workflows/ci.yml"> <img src="https://github.com/scx567888/scx/actions/workflows/ci.yml/badge.svg" alt="CI"/> </a> <a target="_blank" href="https://central.sonatype.com/artifact/cool.scx/scx"> <img src="https://img.shields.io/maven-central/v/cool.scx/scx?color=ff69b4" alt="maven-central"/> </a> <a target="_blank" href="https://github.com/scx567888/scx"> <img src="https://img.shields.io/github/languages/code-size/scx567888/scx?color=orange" alt="code-size"/> </a> <a target="_blank" href="https://github.com/scx567888/scx/issues"> <img src="https://img.shields.io/github/issues/scx567888/scx" alt="issues"/> </a> <a target="_blank" href="https://github.com/scx567888/scx/blob/master/LICENSE"> <img src="https://img.shields.io/github/license/scx567888/scx" alt="license"/> </a> </p> <p align="center"> <a target="_blank" href="https://github.com/helidon-io/helidon"> <img src="https://img.shields.io/badge/Helidon-f44336" alt="Helidon"/> </a> <a target="_blank" href="https://github.com/FasterXML/jackson"> <img src="https://img.shields.io/badge/Jackson-ff8000" alt="Jackson"/> </a> <a target="_blank" href="https://github.com/spring-projects/spring-framework"> <img src="https://img.shields.io/badge/Spring Framework-d8b125" alt="Spring Framework"/> </a> <a target="_blank" href="https://github.com/brettwooldridge/HikariCP"> <img src="https://img.shields.io/badge/HikariCP-44be16" alt="HikariCP"/> </a> <a target="_blank" href="https://github.com/apache/freemarker"> <img src="https://img.shields.io/badge/FreeMarker-29aaf5" alt="FreeMarker"/> </a> <a target="_blank" href="https://github.com/coobird/thumbnailator"> <img src="https://img.shields.io/badge/Thumbnailator-9c27b0" alt="Thumbnailator"/> </a> <br/> <a target="_blank" href="https://github.com/jasypt/jasypt"> <img src="https://img.shields.io/badge/Jasypt-f44336" alt="Jasypt"/> </a> <a target="_blank" href="https://github.com/mysql/mysql-connector-j"> <img src="https://img.shields.io/badge/MySQL Connector/J-ff8000" alt="MySQL Connector/J"/> </a> <a target="_blank" href="https://github.com/jmrozanec/cron-utils"> <img src="https://img.shields.io/badge/Cron utils-d8b125" alt="Cron utils"/> </a> <a target="_blank" href="https://github.com/qos-ch/slf4j"> <img src="https://img.shields.io/badge/SLF4J-44be16" alt="SLF4J"/> </a> <a target="_blank" href="https://github.com/apache/logging-log4j2"> <img src="https://img.shields.io/badge/Apache Log4j 2-29aaf5" alt="Apache Log4j 2"/> </a> <a target="_blank" href="https://github.com/cbeust/testng"> <img src="https://img.shields.io/badge/TestNG-9c27b0" alt="TestNG"/> </a> </p>

English | 简体中文

A Web rapid development framework

Maven

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

Quick start

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

import cool.scx.app.Scx;
import cool.scx.app.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