Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ea30903143
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 22 lines (20 sloc) 0.653 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
CREATE OR REPLACE FUNCTION not_found() RETURNS response_type AS $$
DECLARE
    ret response_type;
BEGIN
    ret.status = 404;
    ret.content_type = 'content-type: text/html';
    ret.content = '<html><head><title>not found</title></head><body><div>not found</div></body></html>';
    RETURN ret;
END;
$$ LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION bad_request() RETURNS response_type AS $$
DECLARE
    ret response_type;
BEGIN
    ret.status = 400;
    ret.content_type = 'content-type: text/html';
    ret.content = '<html><head><title>bad request</title></head><body><div>bad request</div></body></html>';
    RETURN ret;
END;
$$ LANGUAGE plpgsql;
Something went wrong with that request. Please try again.