- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsumhas been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It ha
-
-
-
-
-
-
-
-
-
-
-
- 24
- July 2017
-
-
-
What is Lorem Ipsum?
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsumhas been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It ha
-
-
-
-
-
-
-
-
-
-
-
- 24
- July 2017
-
-
-
What is Lorem Ipsum?
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsumhas been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It ha
-
-
-
-
-
-
-
-
-
-
-
- 24
- July 2017
-
-
-
What is Lorem Ipsum?
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsumhas been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It ha
-
-
-
-
-
-
-
-
-
-
-
- 24
- July 2017
-
-
-
What is Lorem Ipsum?
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsumhas been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It ha
-
-
-
-
-
-
-
-
-
-
-
- 24
- July 2017
-
-
-
What is Lorem Ipsum?
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsumhas been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It ha
-
-
-
-
-
-
-
-
-
-
-
- 24
- July 2017
-
-
-
What is Lorem Ipsum?
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsumhas been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It ha
-
-
-
-
-
-
-
-
-
-
-
- 24
- July 2017
-
-
-
What is Lorem Ipsum?
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsumhas been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It ha
-
-
-
-
-
-
-
-
-
-
-
- Powered by antd server, (c) 2017 - 2018 Xuan Sang LE
-
-
-
\ No newline at end of file
diff --git a/blog/index.ls b/blog/index.ls
new file mode 100644
index 0000000..7e7b26b
--- /dev/null
+++ b/blog/index.ls
@@ -0,0 +1,28 @@
+
\ No newline at end of file
diff --git a/blog/router.lua b/blog/router.lua
new file mode 100644
index 0000000..4ff5f31
--- /dev/null
+++ b/blog/router.lua
@@ -0,0 +1,31 @@
+BLOG_ROOT = __ROOT__.."/blog"
+MAX_ENTRY = 10
+local user = "mrsang"
+local handle = function(p)
+ std.html()
+ local args = {}
+ local sort = {}
+ local i = 1
+ for s in p:gmatch("%:*([^%:]*)") do
+ args[i] = s
+ table.insert(sort, i)
+ i = i+1
+ end
+ table.sort(sort)
+ local api = require("blog.api")
+ if #args == 0 or api == nil then
+ echo("Unknow request "..p)
+ elseif not api[args[1]] then
+ echo("Unknow action.."..args[1])
+ else
+ local action = args[1]
+ args[1] = user
+ local data, sort = api[action](table.unpack(args))
+ if data == nil then
+ echo("Cannot query data")
+ else
+ require("blog.view").render(action, data, sort)
+ end
+ end
+end
+return handle
\ No newline at end of file
diff --git a/blog/template.html b/blog/template.html
new file mode 100644
index 0000000..bbef637
--- /dev/null
+++ b/blog/template.html
@@ -0,0 +1,144 @@
+
+
+
+ Hi, I'm Xuan Sang LE
+
+
+
+
+
+
+
+
+
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsumhas been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It ha
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsumhas been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It ha
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsumhas been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It ha
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsumhas been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It ha
+
+
+
+
+
+
+
+
+
+
+
+ Powered by antd server, (c) 2017 - 2018 Xuan Sang LE
+
+
+
\ No newline at end of file
diff --git a/blog/view.lua b/blog/view.lua
new file mode 100644
index 0000000..b5a6cf6
--- /dev/null
+++ b/blog/view.lua
@@ -0,0 +1,27 @@
+local view = {}
+
+view.html = function(name)
+ local path = BLOG_ROOT.."/view/"..name..".html"
+ local f = io.open(path, "rb")
+ if f then
+ echo(f:read("*all"))
+ f:close()
+ else
+ echo("Cannot find "..path)
+ end
+end
+
+view.render = function(action, data, sort)
+ view.html("top")
+ local path = BLOG_ROOT.."/view"
+ if action == "id" then
+ _G.dbmodel = data[0]
+ doscript(path.."/detail.ls")
+ else
+ _G.dbmodel = { data = data, order = sort }
+ doscript(path.."/entries.ls")
+ end
+ _G.dbmodel = nil
+ view.html("bot")
+end
+return view
\ No newline at end of file
diff --git a/blog/view/bot.html b/blog/view/bot.html
new file mode 100644
index 0000000..6c93ca3
--- /dev/null
+++ b/blog/view/bot.html
@@ -0,0 +1,7 @@
+
+
+
+ Powered by antd server, (c) 2017 - 2018 Xuan Sang LE
+