1 Star 0 Fork 0

redraiment / sqlet

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

sqlet

SQLet: SQL Server Applet.

This is a simple http server for static content, but also run purely SQL scripts to handle request. It is nice to experiment some ideas the quick way by starting a http server in a few seconds, without editing some config file first.

Installation

Download from https://github.com/redraiment/sqlet and build by following steps.

git clone https://github.com/redraiment/sqlet.git
cd sqlet
lein uberjar

You need to install leiningen first.

Usage

java [options] -jar sqlet-1.0.0-standalone.jar

Run the standalone jar, SQLet will start web server to serve the content of current directory. The default port is 1989. For each request, it will execute every *.sql file, and just return the content of the other files.

For each SQL request, SQLet will launch an anonymous in-memory database, and link to a shared database for application & session scope attributes. The HTTP request will be parsed into below tables:

  • app schema
    • attributes table: global application scope configurations.
      • name column
      • value column
  • session schema
    • attributes view: session scope attributes.
      • name column
      • value column
  • request schema
    • context table
      • remote_address column: remote ip.
      • server_name column: server url host name.
      • server_port column: server port.
      • method column: request method.
      • scheme column: http, https.
      • uri column: path of url.
      • query column: query of get method.
      • character_encoding column
      • content_type column
      • content_length column
      • body column: http body string.
    • headers table
      • name column
      • value column
    • cookies table
      • name column
      • value column
    • query_params table: parameters of get method.
      • name column
      • value column
    • form_params table: parameters of post method.
      • name column
      • value column
    • params view: union all query_params and form_params.
      • name column
      • value column
  • response schema
    • context table
      • code column: HTTP response code. 200 default.
      • content_type column: application/json; charset=utf-8 default.
      • body column: response body string.
    • headers table
      • name column
      • value column
    • cookies table
      • name column: cookie name
      • value column: the new value of the cookie
      • path column: the subpath the cookie is valid for
      • domain column: the domain the cookie is valid for
      • max_age column: the maximum age in seconds of the cookie
      • expires column: a date string at which the cookie will expire
      • secure column: set to true if the cookie requires HTTPS, prevent HTTP access
      • http_only column: set to true if the cookie is valid for HTTP and HTTPS only

Options

  • -Dsqlet.port=<port>: Listen on port <port> for incoming connections.

Examples

Save below content as index.sql.

insert into response.content (content_type, body) values ('text/html; charset=utf-8', '<h1>Hello world</h1>');

Then start SQLet server, and visit http://localhost:1989/index.sql .

License

Copyright © 2018 FIXME

Distributed under the FreeBSD Copyright.

空文件

简介

SQLet: SQL Server Applet. 用纯SQL做Web服务端开发。 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/redraiment/sqlet.git
git@gitee.com:redraiment/sqlet.git
redraiment
sqlet
sqlet
master

搜索帮助