lets-blade /blade
:rocket: Lightning fast and elegant mvc framework for Java8
★ 5,870⑂ 1,151👁 278⑃ 202● 261▤ 9
+0
Daily
+0
Weekly
+2
Monthly
5,870
stars
1,151
forks
278
watchers
202
prs
261
issues
9
releases
README
Based on Java8 + Netty4 to create a lightweight, high-performance, simple and elegant Web framework 😋
Spend 1 hour to learn it to do something interesting, a tool in addition to the other available frameworks.
🐾 Quick Start |
🌚 Documentation |
:green_book: Guidebook |
💰 Donate |
🇨🇳 简体中文
What Is Blade?
Blade is a pursuit of simple, efficient Web framework, so that JavaWeb development becomes even more powerful, both in performance and flexibility.
If you like to try something interesting, I believe you will love it.
If you think it's good, you can support it with a star or by donating :blush:
Features
[x] A new generation MVC framework that doesn't depend on other libraries
[x] Get rid of SSH's bloated, modular design
[x] Source is less than 500kb, learning it is also simple
[x] RESTful-style routing design
[x] Template engine support, view development more flexible
[x] High performance, 100 concurrent qps 20w/s
[x] Run the JAR package to open the web service
[x] Streams-style API
[x] CSRF and XSS defense
[x] Basic Auth and Authorization
[x] Supports plug-in extensions
[x] Support webjars resources
[x] Tasks based on cron expressions
[x] Built-in a variety of commonly used middleware
[x] Built-in Response output
[x] JDK8 +
Overview
» Simplicity: The design is simple, easy to understand and doesn't introduce many layers between you and the standard library. The goal of this project is that the users should be able to understand the whole framework in a single day.
» Elegance: blade supports the RESTful style routing interface, has no invasive interceptors and provides the writing of a DSL grammar.
» Easy deploy: supports maven package jar file running.
Quick Start
Create a basic Maven or Gradle project.
Do not create a webapp project, Blade does not require much trouble.
Run with Maven:
xml
com.hellokaton
blade-core
2.1.2.RELEASE
or Gradle:
sh
compile 'com.hellokaton:blade-core:2.1.2.RELEASE'
Write the main method and the Hello World:
java
public static void main(String[] args) {
Blade.create().get("/", ctx - ctx.text("Hello Blade")).start();
}
Open http://localhost:9000 in your browser to see your first Blade application!
Contents
- Register Route
- HardCode
- Controller
- Request Parameter
- URL Parameter
- Form Parameter
- Path Parameter
- Body Parameter
- Parse To Model
- Get Environment
- Get Header
- Get Cookie
- Static Resource
- Upload File
- Download File
- Set Session
- Render To Browser
- Render Response
- Render Text
- Render Html
- Render Template
- Default Template
- Jetbrick Template
- Redirects
- Write Cookie
- Web Hook
- Logging
- Basic Auth
- Change Server Port
- Configuration SSL
- Custom Exception Handler
Register Route
HardCode
java
public static void main(String[] args) {
// Create multiple routes GET, POST, PUT, DELETE using Blade instance
Blade.creat