panel/app.moon

26 lines
582 B
Plaintext

lapis = require "lapis"
db = require "lapis.db"
csrf = require "lapis.csrf"
encoding = require "lapis.util.encoding"
import respond_to from require "lapis.application"
require "models.user"
class App extends lapis.Application
@include "controllers.users"
[index: "/"]: =>
@user = @session.user
render: true
[freeswitch: "/freeswitch"]: respond_to {
POST: =>
uid = @params["user"] or @params["sip_auth_username"]
@user = Users\find extension: uid
if not @user
return status: 404, "no such user"
render: true, layout: false
}