middie
main
middie | main | |
---|---|---|
2 | 2 | |
234 | 274 | |
1.7% | 1.8% | |
5.8 | 3.2 | |
7 days ago | about 2 months ago | |
JavaScript | JavaScript | |
MIT License | Apache License 2.0 |
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.
middie
-
Advanced Fastify: Hooks, Middleware, and Decorators
Fastify also supports Express-style middleware but it requires you to install an external plugin such as @fastify/express or @fastify/middie. This eases migration from Express to Fastify, but it should not be used in greenfield projects in favor of hooks. Note that in many cases, you can find a native Fastify plugin that provides the same functionality as Express middleware.
- Help Converting Express Routes/Middleware/Controllers to Fastify
main
-
My code is always buggy
Here's an example of a test that covers a lot: Let's say that you have a view that shows a list of users. To get those users you would most likely have a backend that has some API. You can request that API with Postman, that way you know that your request is valid, and you get a very realistic response (assuming this is a test environment or whatever. Just don't use production data). Then you use something like MockServer and set up the request as expectation and the response as what should be returned. After that, you can write a test that verifies that the correct number (with some tactically chosen verification of values) of users show up in the list. Now you have a test that covers a huge portion of the codebase, while being very user-centric and easy to maintain.
-
A Node.js configuration provider reading files, environment and arguments
@mocks-server/config - It allows to define configuration options, and it reads environment variables and uses cosmiconfig and commander under the hood to provide values to them.
What are some alternatives?
mercurius - Implement GraphQL servers and gateways with Fastify
cosmiconfig - Find and load configuration from a package.json property, rc file, TypeScript module, and more!
nodejs-integration-test-practices-and-examples - ✅ Master the art of the most powerful testing technique for Node.js: Component tests. Including super-comprehensive best practices list and an example app (August 2021) [Moved to: https://github.com/testjavascript/nodejs-integration-tests-best-practices]
mocktail - Free, 11MB, containerized, self-hosted mock server.
fastify-dx - Archived
DeepfakeHTTP - DeepfakeHTTP is a web server that uses HTTP dumps as a source for responses.
fastify-express - Express compatibility layer for Fastify
nodejs-mongodb-backend-boilerplate - Best Backend Boilerplate for MERN Stack.
Hospital Run - Backend for HospitalRun
pageres-cli - Capture website screenshots
nodejs-integration-tests-best-practices - ✅ Beyond the basics of Node.js testing. Including a super-comprehensive best practices list and an example app (March 2024)
openapi-enricher - Enrich an OpenAPI spec with response examples to mock it efficiently