Skip to content

Flash is a lightweight, highly expressive web framework for Java.

License

Notifications You must be signed in to change notification settings

Pixel-Services/flash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flash

Flash is a lightweight, highly expressive multithreaded web framework for Java. It is designed to offer enhanced performance, additional features, and a modernized development experience.

Flash is perfect for building RESTful APIs and simple web applications. Its minimalist design ensures ease of use while maintaining flexibility and power for more advanced needs.


Installation

To include Flash in your project, add the following dependency and repository to your pom.xml:

Dependency

<dependency>
    <groupId>com.pixelservices</groupId>
    <artifactId>flash</artifactId>
    <version>${flashversion}</version>
</dependency>

Repository

<repository>
    <id>pixel-services-releases</id>
    <name>Pixel Services</name>
    <url>https://maven.pixel-services.com/releases</url>
</repository>

Quick Start

Here’s a simple example of a Flash application:

public class HelloWorld {
    private final int PORT = 8080;
    public static void main(String[] args) {
        FlashServer server = new FlashServer(PORT);
        server.get("/hello", (req, res) -> "Hello, World!"); //Defines a simple GET route.

        //Serves a Swagger visualization of the autogenerated OpenAPI schema
        server.openapi("/docs", new OpenAPIConfiguration(
            "Flash Server",           // Title
            "Generated by Flash!",    // Description
            "1.0",                    // Version
            List.of("http://localhost:" + PORT)  // List of servers to be used in Swagger for test API calls
        ), OpenAPIUITemplate.SWAGGER);  // Specifies the type of Swagger UI (can be SWAGGER/REDOC/CUSTOM)

        //Serves the contents of a FS folder/resourcestream with MIME types handling.
        server.serveStaticFiles("/static", new StaticFileServerConfiguration(
            true,                        // Enable file watching for source folder changes
            true,                        // Enable automatic redirect from /static to /static/index.html
            Path.of("path/to/src")       // Path to the source folder containing static assets
        ));

        server.start(); //Starts the server
    }
}

Documentation


Contributing

We welcome contributions! To contribute to Flash:

  1. Fork the repository: Flash on GitHub
  2. Create a feature branch: git checkout -b feature-name
  3. Commit your changes: git commit -m 'Add feature'
  4. Push to the branch: git push origin feature-name
  5. Submit a pull request.

About

Flash is a lightweight, highly expressive web framework for Java.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages