UNPKG

@tsed/common

Version:
30 lines 837 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Location = void 0; const endpointFn_1 = require("./endpointFn"); /** * Sets the response Location HTTP header to the specified path parameter. * * ```typescript * @Location('/foo/bar') * @Location('http://example.com') * @Location('back') * private myMethod() { * * } * ``` * * A path value of “back” has a special meaning, it refers to the URL specified in the `Referer` header of the request. If the `Referer` header was not specified, it refers to “/”. * * @param location * @returns {Function} * @decorator * @operation */ function Location(location) { return endpointFn_1.EndpointFn((endpoint) => { endpoint.location = location; }); } exports.Location = Location; //# sourceMappingURL=location.js.map