daniel-boll / axum-js Goto Github PK
View Code? Open in Web Editor NEWA Axum http wrapper for NodeJS
License: MIT License
A Axum http wrapper for NodeJS
License: MIT License
To make axum-js
a more comprehensive and versatile API framework, it's essential to extend support to all standard HTTP methods. As of now, only the get
method is implemented. This task involves adding the remaining standard HTTP methods: post
, put
, delete
, options
, head
, patch
, trace
, and connect
.
Each method should accept a path (as a string) and a callback function, similar to the existing get
method. This enhancement should follow the pattern established in Issue #3 (Extend get
Method to Support Callbacks).
Example for the post
method:
app.post('/', (req, res) => {
res.send('Post request received!')
});
Acceptance Criteria:
post
, put
, delete
, options
, head
, patch
, trace
, and connect
methods, adhering to the callback support pattern established in Issue #3.STYLE_GUIDE.md
and be consistent with existing code patterns.Dependencies:
get
Method to Support Callbacks).Additional Context:
Implementing these additional HTTP methods will significantly enhance the versatility and utility of axum-js
, aligning it with other full-featured server frameworks.
The README includes a simplified example of how to use axum-js
to create a basic API. The task is to ensure that the provided example is functional and accurately represents the usage of axum-js
. The implementation should follow the guidelines and structure as depicted in the README:
import { axum } from "@lambda-group/axum-js";
const app = axum();
const port = 3000;
app.get('/', (req, res) => {
res.send('Hello World!')
});
app.listen(port, () => {
console.log(`Server is humming on port ${port}`)
});
Acceptance Criteria:
STYLE_GUIDE.md
.To ensure the reliability and correctness of the HTTP methods implemented in axum-js
, comprehensive tests need to be written. These tests should cover all the HTTP methods (get
, post
, put
, delete
, options
, head
, patch
, trace
, connect
) and verify their functionality as expected.
Each test should check the following:
Acceptance Criteria:
STYLE_GUIDE.md
.Dependencies:
get
method to support callbacks Issues #3 and #4.Additional Context:
Having a robust set of tests is crucial for ensuring the reliability of axum-js
, particularly as more features are added and the codebase grows.
The aim is to create comprehensive documentation for axum-js
to aid developers in understanding, using, and contributing to the project. The documentation should be created using Docusaurus, hosted on Vercel, and accessible via a custom domain registered through Free Domain Registration with a *.is-an.app
domain.
The documentation should be structured and include the following sections:
Steps:
docs/
directory in the project.*.is-an.app
domain and configure it to point to the Vercel deployment.Acceptance Criteria:
Additional Context:
Creating thorough documentation is a crucial step for the growth and adoption of axum-js
. Hosting this documentation on a dedicated, easily accessible site will provide a better user experience for developers.
The current implementation of the get
method in axum-js
only accepts a string argument for specifying the path. To enhance its functionality and align with common JavaScript/TypeScript practices, it is essential to extend the get
method to also accept a callback function. This callback function should be executed when the route is accessed.
Currently:
app.get('/', (req, res) => {
res.send('Hello World!')
});
The callback function provides a mechanism to handle requests and send responses, enabling more dynamic and interactive API endpoints.
Acceptance Criteria:
get
method to accept a callback function as an argument alongside the path string.STYLE_GUIDE.md
and is consistent with existing code patterns.Additional Context:
Supporting callbacks is a step towards making axum-js
more flexible and user-friendly, aligning with common patterns used in JavaScript and TypeScript-based server frameworks.
To enhance debugging and observability, it's proposed to add optional default logging within the Rust modules of axum-js
. This logging should cover key events such as server startup, routes registration, and any other significant lifecycle events. The logging should be designed to be toggled on or off via a JavaScript API to avoid unnecessary log verbosity in production environments.
A proposed API in JavaScript to enable logging might look like this:
import { AxumApp } from "./index";
const app = new AxumApp();
app.registerLogging({ emoji: true, timestamp: true });
In this example:
emoji: true
would enable emoji icons in log messages for better readability and quicker identification of log levels or events.timestamp: true
would prepend timestamps to log messages to provide context on when events occurred.Potential log messages include:
Acceptance Criteria:
STYLE_GUIDE.md
.Enhance the project's visual appeal and provide quick status insights by adding a Socialify banner and badges for deployment and tests to the README. Furthermore, include a section encouraging users to consider sponsoring the project to help support its ongoing development.
Steps:
Acceptance Criteria:
STYLE_GUIDE.md
.Dependencies:
Additional Context:
Enhancing the README with a banner, badges, and sponsorship section will not only make the project more engaging but also provide a pathway for financial support to ensure its continued development.
To improve the organization and manageability of our automation processes, it's proposed to separate tests and Continuous Integration (CI) into distinct workflows. Currently, they are intertwined, making it hard to isolate issues and manage them independently. This separation will allow for more precise control and easier troubleshooting of each process.
Acceptance Criteria:
Additional Context:
Separating tests and CI into different workflows will not only improve the organization but also the clarity and manageability of our automation processes, making it easier to maintain and troubleshoot the project.
We have identified a need to automate the management of issue dependencies and labels within our repository. The goal is to create a GitHub Action that will automatically check for dependencies whenever an issue is resolved, and update the labels on dependent issues accordingly.
Acceptance Criteria:
on hold
label from that issue.Tasks:
Notes:
As axum-js
approaches feature completeness, it's crucial to benchmark its performance to understand its capabilities and identify any potential areas of optimization. This issue serves as a placeholder and outline for the benchmarking task to be revisited once the library is feature-complete.
Preliminary Steps (to be updated):
Acceptance Criteria (to be updated):
Dependencies:
axum-js
.Additional Context:
This issue will be further detailed and actioned upon once axum-js
reaches a state of feature completeness. Benchmarking is a vital step to ensure axum-js
performs optimally and is ready for production use.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.