@blackglory/http-status
Version:
A class-based HTTP status library
49 lines (40 loc) • 1.14 kB
text/typescript
import { HTTPStatus } from './http-status.js'
import { Redirection } from './enum.js'
export class HTTPRedirection implements HTTPStatus {
constructor(public readonly code: number, public readonly message: string) {}
}
export class MultipleChoice extends HTTPRedirection {
constructor() {
super(Redirection.MultipleChoice, 'Multiple Choice')
}
}
export class MovedPermanently extends HTTPRedirection {
constructor() {
super(Redirection.MovedPermanently, 'Moved Permanently')
}
}
export class Found extends HTTPRedirection {
constructor() {
super(Redirection.Found, 'Found')
}
}
export class SeeOther extends HTTPRedirection {
constructor() {
super(Redirection.SeeOther, 'See Other')
}
}
export class NotModified extends HTTPRedirection {
constructor() {
super(Redirection.NotModified, 'Not Modified')
}
}
export class TemporaryRedirect extends HTTPRedirection {
constructor() {
super(Redirection.TemporaryRedirect, 'Temporary Redirect')
}
}
export class PermanentRedirect extends HTTPRedirection {
constructor() {
super(Redirection.PermanentRedirect, 'Permanent Redirect')
}
}