http.cat
axios
http.cat | axios | |
---|---|---|
69 | 4 | |
2,718 | 202 | |
2.0% | 2.5% | |
7.4 | 9.4 | |
about 1 month ago | 2 days ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
http.cat
-
Ask HN: Happy 404 Day. Whats your favorite 404 error page?
Cats for other HTTP status codes can be found (or not found :-)) one level up
https://http.cat
- HTTP Area Codes
- Lidando com exceções: como fazer erros práticos e elegantes no Express js
- HTTP Cats
-
What I've learnt in 1 month of programming
Whenever we request data or services from a server, it can respond with status codes represented by numbers. You've probably heard of "404" which means "not found", but there are others like "201 - Created" and "500 - Internal Server Error." During one of my mentoring sessions, I was given a website that showcased all these status codes with kitten memes and a brief description. It was fantastic and helped me grasp each one of those statuses better.
- Entendendo os códigos de status HTTP: Um guia teórico para desenvolvedores
- HTTP Status Dogs. Hypertext Transfer Protocol Response Status Codes. and Dogs
-
NestJS tip: how to inject multiple versions of the same provider into one module (e.g.: many Axios instances)
import { Module, OnModuleInit } from '@nestjs/common' import { HttpModule, HttpService } from '@nestjs/axios' import { CatApi } from './cat-api.service' @Module({ imports: [ HttpModule.register({ // line A timeout: 1_000, maxRedirects: 2, baseURL: 'https://http.cat', }), ], providers: [ { provide: CatApi, useExisting: HttpService, // line B } ], exports: [CatApi], // line C }) export class CatApiModule implements OnModuleInit { constructor(private readonly httpService: HttpService) {} onModuleInit() { this.httpService.axiosRef.defaults.headers.common['Accept'] = 'application/json' } }
- I'm a Teapot
- 15 May 2023 - Daily Chat Thread
axios
-
NestJS tip: how to inject multiple versions of the same provider into one module (e.g.: many Axios instances)
For example, when using the HttpModule module from @nestjs/axios we can use the dynamic module HttpModule.register() to configure our Axios instance. That module exposes a HttpService that has such configuration. But what if we want to have many Axios instances, each one with its own config and import everything in one module?
-
Is NestJS good for startups?
e.g. there's no reason in one of these systems where you couldn't just use Axios (or fetch) on its own to make outside requests. But instead, for no good reason, Nest wants to wrap Axios for you in a way that allows you to only really grab a single instance at a time. Which is not how Axios is meant to be used. This makes it so that you can't use the baseURL config option which is one of the most important options when constructing a client that's meant to work with a particular service. You could use a named injector but at this point there's no reason to not just pass around an instance other than Nest seemingly having this alternate pointless way of doing things. So basically, yes, in this case Nest pushes you into a pattern but that pattern isn't just ugly... it's inherently limiting to you while being more verbose and decreasing readability.
-
NestJs: Intercept axios responses and throw built-in HTTP errors for the exception filter
NestJs HttpModule
- Axios shipped a buggy version and it broke many productions apps. Let this be a lesson to pin your dependencies!
What are some alternatives?
httpstatuses - A directory of HTTP Status Codes and code references
Playwright - Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
hiddentools - ✨ Discover a wide collection of unique tools
Nest - A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
rockstar - The Rockstar programming language specification
tsrpc - A TypeScript RPC framework, with runtime type checking and serialization, support both HTTP and WebSocket. It is very suitable for website / APP / games, and absolutely comfortable to full-stack TypeScript developers.
purest - REST API Client Library
swagger - OpenAPI (Swagger) module for Nest framework (node.js) :earth_americas:
just-api - :boom: Test REST, GraphQL APIs
fastify-swagger - Swagger documentation generator for Fastify
curriculum - The open curriculum for learning web development
nestjs-axios-interceptor - NestJs: Intercept axios responses and throw built-in HTTP errors for the exception filter