@vp_solutions/http-statuses
v1.0.0
Published
Package contain enum of HTTP status codes.
Downloads
3
Readme
@vp_solutions/http-statuses
Package provide enum with http status codes. Using this enum you can process any response/request statuses on back-end and front-end side.
Example of usage with Express:
import * as express from 'express';
import { HttpStatusCode } from '@vp_solutions/http-statuses';
const app = express();
app.use((req, res, next) => {
if (req.params.id !== undefined) {
return res.status(HttpStatusCode.BadRequest).json({ message: "param 'id' is required" });
}
return next();
});