i hate nim
This commit is contained in:
parent
6e222f7529
commit
4f40e59b17
17 changed files with 1439 additions and 31 deletions
|
@ -1,4 +1,4 @@
|
|||
import prologue, prologue/middlewares/staticfile, std/json, sysrandom, asyncdispatch, std/strutils, db_connector/db_sqlite, std/asyncnet
|
||||
import prologue, prologue/middlewares/staticfile, prologue/middlewares/cors, std/json, sysrandom, asyncdispatch, std/strutils, db_connector/db_sqlite, std/asyncnet
|
||||
|
||||
const key_len = 128
|
||||
const refer_len = 16
|
||||
|
@ -52,7 +52,9 @@ proc gentry*(ctx: Context) {.async.} =
|
|||
resp jsonResponse(info)
|
||||
|
||||
var app = newApp()
|
||||
|
||||
app.use(CorsMiddleware(allowOrigins = @["*"], allowHeaders = @["*"], allowMethods = @["*"]))
|
||||
app.use(staticFileMiddleware("./public"))
|
||||
app.addRoute("/", index)
|
||||
app.addRoute("/entry", gentry)
|
||||
app.run()
|
||||
app.run()
|
Loading…
Add table
Add a link
Reference in a new issue