This project is a back-end API server built using Express.js and TypeScript. It provides RESTful API endpoints for interacting with Git repositories.
To install the project, follow these steps:
- Clone the repository to your local machine.
- Install the dependencies by running
npm install
||yarn
. - Build the project by running
npm run build
||yarn build
. - Start the server by running
npm start
||yarn start
.
The following API endpoints are available:
Endpoint | Description |
---|---|
/api/v1/repositories |
Returns a list of all repositories. |
/api/v1/repositories/:id |
Returns information about a specific repository. |
/api/v1/repositories/:id/commits |
Returns a list of commits for a specific repository. |
/api/v1/repositories/:id/commits |
Returns information about a specific commit. |
This is a simple example of an Express.js server that supports both WebSocket communication using Socket.io and stateless communication through a RESTful HTTP API.
- WebSocket (Socket.io): Real-time, bidirectional communication for stateful interactions.
- HTTP API (Express): Stateless communication through RESTful routes.
To use the API, send HTTP requests to the appropriate endpoint. For example, to get a list of all repositories, send a GET request to /api/v1/repositories
.
If you would like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your changes.
- Make your changes and commit them.
- Push your changes to your fork.
- Create a pull request.
I hope this helps! Let me know if you have any other questions.
- Utility Types In TypeScript (https://www.typescriptlang.org/docs/handbook/utility-types.html)
- Socket.IO Server Initialization (https://socket.io/docs/v4/server-initialization/)