generated from jsynowiec/node-typescript-boilerplate
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* FEATURE: Added PassiveSearch v1 - Added Connection to ElasticSearch - Added 2 API's - /ping and /passive - Keyword Search using /passive - Added Storing to DB capability when using /search * Fix: Added error handling -added error handling for passivesearch api endpoint * FEATURE: Added Simple Query String - Changed ElasticSearch Search type to Simple Query String * REFACTOR: Improved Active Search -Made Active Search make better use of downtimes (Rate Limits or Validation Downtime) * FIX: Issues with Active Search -Fixed errors with parrallel processing * FEATURE: Added SeedScript - Added RootQuery as an optional query param for activesearch which basically takes out the prompt builder and takes a raw query to look for in Github API. - Added Python SeedScript * REFACTOR: Changed Data Model for Storing in Database - Added other fields like LastUpdated, ETAG, URL, LastModified to Schema. - Added SHA hash as the unique parameter to not allow duplicates in the database * REFACTOR: Minor Log Refactor - Changed console.log to console.info / console.error * FIX: Storing only the reqd part of URL * FEATURE: Update API -Added PUT /database endpoint for updating the database - Changed name of the endpoints - Commented Database Trace Logs * FIX: Update API Fix + Global ElasticSearch and Octokit Clients - Fixed GetFileContents - Added Global variables for EsClient and Octokit for easy access and clean code - Better logs * FIX: Minor Comment * REFACTOR: UpdateAPI refactor - Update API Refactored * REFACTOR: Minor Fixes - Better API Naming - Fixed Update API * FIX: Fixed Seed Script * FIX: reverting '/' api * FEATURE: Added Dockerfiles -Added Dockerfile * BUG: Minor Fixes - Made tests work - Added basic Admin Panel - Did prettier leading to so many changes in this commit * BUG: fixed tests * UI Fixes * UI Stuff
- Loading branch information
Showing
26 changed files
with
4,544 additions
and
395 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import request from 'supertest'; | ||
import app from '../src/app.js'; | ||
import axios from 'axios'; | ||
|
||
describe('Test app.ts', () => { | ||
test('Catch-all route', async () => { | ||
const res = request(app).get('/'); | ||
expect(res).toEqual('TypeScript With Express'); | ||
describe('API Tests', () => { | ||
test('GET /', async () => { | ||
const response = await axios.get('http://localhost:8080/'); | ||
expect(response.status).toBe(200); | ||
}); | ||
test('GET /ping', async () => { | ||
const response = await axios.get('http://localhost:8080/ping'); | ||
expect(response.status).toBe(200); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
version: '3' | ||
services: | ||
elasticsearch: | ||
image: docker.elastic.co/elasticsearch/elasticsearch:8.8.2 | ||
container_name: elasticsearch | ||
environment: | ||
- discovery.type=single-node | ||
- xpack.security.enabled=false | ||
ports: | ||
- '9200:9200' | ||
- '9300:9300' | ||
volumes: | ||
- esdata:/usr/share/elasticsearch/data | ||
|
||
app: | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile | ||
environment: | ||
- PORT=${PORT} | ||
- GITHUB_API_KEY=${GITHUB_API_KEY} | ||
- ES_HOST=host.docker.internal | ||
ports: | ||
- '${PORT}:${PORT}' | ||
depends_on: | ||
- elasticsearch | ||
links: | ||
- elasticsearch | ||
|
||
volumes: | ||
esdata: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM node:18-alpine | ||
|
||
WORKDIR /usr | ||
|
||
COPY ./package.json ./package-lock.json ./.prettierrc ./.eslintrc.json ./jest.config.js ./tsconfig.json ./tsconfig.release.json ./ | ||
RUN npm install | ||
|
||
COPY ./src ./src | ||
|
||
EXPOSE 8080 | ||
|
||
RUN npm run build | ||
COPY ./src/templates ./build/src/templates | ||
CMD ["npm", "run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.