tweyseo / Shredder

a simple APIServer demo based on OpenResty and lor. (Shredder was one of my favorite heroes in dota)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

APIServer

Overview

It's a demo of APIServer based on OpenResty and lor.

This demo dedicated to demonstrating usages of common components in APIServer which based on OpenResty.

The APIServer follow the specifications of process below:

  1. middleware handle every request first,
  2. next the handler you specify in router (actually in every index.lua of specific handler) process the corresponding request,
  3. then the module and the dao will handle the actual logic and data,
  4. then back to the handler which will do response,
  5. do log at logStage.lua.

note that, server.lua and init.lua were invoked only when the first request arrived.

Useage

You are recommended to use start.sh, reload.sh and stop.sh to start, reload and stop your APIServer, of course, you should specify your path of OpenResty in the scripts above and restys (lor, http, rediscluster, LFS, lua-resty-json)that was depended.

TODO

  1. the spec and example of the dao layer under the model layer.

License

MIT

About

a simple APIServer demo based on OpenResty and lor. (Shredder was one of my favorite heroes in dota)

License:MIT License


Languages

Language:Lua 92.2%Language:Shell 7.8%