Add /api/sign_(in|out).json endpoints, uncomment sign in/out logic in navbar and...
[ndcode_site.git] / _lib / post_request.jst
index 2b968bb..59c780e 100644 (file)
@@ -1,6 +1,6 @@
 let stream_buffers = require('stream-buffers')
 
-return async (env, endpoint, func) => {
+return async (env, endpoint, handler) => {
   let Problem = await _require('/_lib/Problem.jst')
 
   let result
@@ -26,7 +26,7 @@ return async (env, endpoint, func) => {
     let arguments = JSON.parse((await data).toString())
     console.log('endpoint', endpoint, 'arguments', JSON.stringify(arguments))
 
-    result = await func(...arguments)
+    result = await handler(...arguments)
     if (result === undefined)
       result = null
     console.log('endpoint', endpoint, 'result', JSON.stringify(result))