From bcce03dc4a6adfe2023f99c058f2d2a6b4e6d7a2 Mon Sep 17 00:00:00 2001
From: Rash
Date: Sun, 11 Aug 2024 13:13:53 +0100
Subject: [PATCH] |#4 | @rashjredmund | did api versioning and updated landing
page in API base route
---
.husky/pre-commit | 3 --
README.md | 49 +++++++++++++------
public/main.html | 29 +++++++++--
src/api/v1/index.ts | 18 +++++++
src/{ => api/v1}/middlewares/index.ts | 0
.../v1}/modules/auth/auth.controller.ts | 0
src/{ => api/v1}/modules/auth/auth.service.ts | 0
.../modules/languages/language.controller.ts | 0
.../v1}/modules/languages/language.service.ts | 0
.../v1}/modules/match/match.controller.ts | 0
.../v1}/modules/match/match.service.ts | 0
src/{ => api/v1}/routes/auth-router.ts | 0
src/{ => api/v1}/routes/language-router.ts | 0
src/{ => api/v1}/routes/match-router.ts | 0
src/api/v2/index.ts | 17 +++++++
src/server/index.ts | 8 +--
16 files changed, 97 insertions(+), 27 deletions(-)
create mode 100644 src/api/v1/index.ts
rename src/{ => api/v1}/middlewares/index.ts (100%)
rename src/{ => api/v1}/modules/auth/auth.controller.ts (100%)
rename src/{ => api/v1}/modules/auth/auth.service.ts (100%)
rename src/{ => api/v1}/modules/languages/language.controller.ts (100%)
rename src/{ => api/v1}/modules/languages/language.service.ts (100%)
rename src/{ => api/v1}/modules/match/match.controller.ts (100%)
rename src/{ => api/v1}/modules/match/match.service.ts (100%)
rename src/{ => api/v1}/routes/auth-router.ts (100%)
rename src/{ => api/v1}/routes/language-router.ts (100%)
rename src/{ => api/v1}/routes/match-router.ts (100%)
create mode 100644 src/api/v2/index.ts
diff --git a/.husky/pre-commit b/.husky/pre-commit
index 14ccce4..1382386 100644
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1,4 +1 @@
-#!/usr/bin/env sh
-. "$(dirname -- "$0")/_/husky.sh"
-
npm run pre-commit
\ No newline at end of file
diff --git a/README.md b/README.md
index a60b58f..61fd988 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# wiki-lex-match
-__table of content__
+**table of content**
- [local setup](#setup-repo-locally)
- [how to render the](#how-to-render-the-documentation)
@@ -9,7 +9,7 @@ __table of content__
## setup repo locally
- Clone repo with
-
+
```bash
git clone git@github.com:Wikidata-Cameroon/WMA_HackKmer_Yaounde_Backend.git wiki-lex-match-backend
```
@@ -20,27 +20,48 @@ __table of content__
cd wiki-lex-match-backend
```
+- Run the following command on your terminal to install packages and dependencies with npm
+
+ ```bash
+ npm install
+ # or npm i for short
+ ```
+
+### Note
+
+- If you do not have node or npm installed to your machine, download and install the runtime from [node](https://nodejs.org/en/download/package-manager)
+
## How to start server
- Start local server in watch mode
- ```bash
- npm run dev
- ```
+ ```bash
+ npm run dev
+ ```
+
+- Generate Project Build
-- Build to js
+ ```bash
+ npm run build
+ ```
- ```bash
- npm run build
- ```
+- Visit API locally through
+
+ ```bash
+ http://localhost/8080
+
+ # You can navigate to API version 1 (the current latest version)
+ http://localhost/8080/api/v1
+ ```
## Contributing
-- __Git flow__
+- **Git flow**
- Branches should be name with `feature/` format
- Writing commits
+
- Commit messages should follow the for mat `# | | `
- @example is `"|#1 | @rashjredmund | installed express and configured base project template. setup hustky, prettier, and eslint. also updated readme file"`
@@ -59,8 +80,8 @@ __table of content__
- Always assign the PR to yourself and your team-mate
-- __Building__
-
+- **Building**
+
- Navigate to `src/modules/` to start contributing
- Set up your routes in the `src/route/*` directory in the right file or add one if need be
@@ -69,6 +90,6 @@ __table of content__
|
-___
+---
-__Happy Coding Everyone 🚀__
+**Happy Coding Everyone 🚀**
diff --git a/public/main.html b/public/main.html
index 7d043dc..86febf3 100644
--- a/public/main.html
+++ b/public/main.html
@@ -42,10 +42,31 @@
target="_blank">@rebase code camp
-
- API docs
-
+