daton/app/http/controllers/Api.controller.ts

26 lines
632 B
TypeScript

import BaseApiController from "../../../lib/src/http/ApiController.ts";
import {Request} from "../../../lib/src/http/Request.ts";
import {redirect} from "../../../lib/src/http/response/helpers.ts";
export default class ApiController extends BaseApiController {
get_good(request: Request) {
return {
session_key: request.session.get_key(),
}
}
get_arr(request: Request) {
return ['alpha', 'bravo', 'charlie', 'delta', 'echo']
}
get_msg(request: Request) {
return 'Hello, world!'
}
get_redirect(request: Request) {
return redirect('/home')
}
}