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.
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.
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
columnvalue
columnsession
schema
attributes
view: session scope attributes.
name
columnvalue
columnrequest
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
columncontent_type
columncontent_length
columnbody
column: http body string.headers
table
name
columnvalue
columncookies
table
name
columnvalue
columnquery_params
table: parameters of get method.
name
columnvalue
columnform_params
table: parameters of post method.
name
columnvalue
columnparams
view: union all query_params
and form_params
.
name
columnvalue
columnresponse
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
columnvalue
columncookies
table
name
column: cookie namevalue
column: the new value of the cookiepath
column: the subpath the cookie is valid fordomain
column: the domain the cookie is valid formax_age
column: the maximum age in seconds of the cookieexpires
column: a date string at which the cookie will expiresecure
column: set to true if the cookie requires HTTPS, prevent HTTP accesshttp_only
column: set to true if the cookie is valid for HTTP and HTTPS only-Dsqlet.port=<port>
: Listen on port <port>
for incoming connections.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 .
Copyright © 2018 FIXME
Distributed under the FreeBSD Copyright.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。