# Location Decorator operation
Module | import { Location } from "@tsed/common" |
---|---|
Source | /packages/common/src/mvc/decorators/method/location.ts |
# Overview
function Location(location: string): Function;
# Description
Sets the response Location HTTP header to the specified path parameter.
@Location('/foo/bar')
@Location('http://example.com')
@Location('back')
private myMethod() {
}
1
2
3
4
5
6
2
3
4
5
6
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 “/”.
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Jest
- Seq
- Controllers
- Providers
- Model
- Converters
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing