Skip to content

Commit

Permalink
Merge pull request #7 from TECHOUS/dev
Browse files Browse the repository at this point in the history
Added the API Docs
  • Loading branch information
GauravWalia19 committed Oct 22, 2023
2 parents 71857be + 13a16e2 commit 2a82db1
Show file tree
Hide file tree
Showing 29 changed files with 4,412 additions and 1,299 deletions.
1 change: 0 additions & 1 deletion .github/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const connectMongoDB = () => {
mongoose.connect(process.env.MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
})
const db = mongoose.connection
db.on('error', console.error.bind(console, 'Connection error:'))
Expand Down
18 changes: 18 additions & 0 deletions api/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
const express = require('express')
const cors = require('cors')
const rateLimit = require('express-rate-limit')
const path = require('node:path')
const {
badRequestHandler,
requestMethodHandler,
internalServerErrorHandler,
} = require('../src/errorHandler')

const app = express()

Expand All @@ -21,6 +27,9 @@ const rateLimiter = rateLimit({
// see https://expressjs.com/en/guide/behind-proxies.html
app.set('trust proxy', 1)

// for hosting documentation on root
app.use(express.static(path.join(__dirname, 'public')))

// rate limiting middleware
app.use(rateLimiter)

Expand All @@ -33,7 +42,16 @@ app.use(express.json())
// express middleware handling the form parsing
app.use(express.urlencoded({extended: false}))

// middleware to handle wrong method types
app.use(requestMethodHandler)

// middleware for handling sample api routes
app.use('/api/v1', require('../routes/api/v1/API'))

// middleware to handle internal server errors due to implementation
app.use(internalServerErrorHandler)

// middleware to handle bad requests
app.use(badRequestHandler)

module.exports = app
Binary file added api/public/assets/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/public/assets/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/public/assets/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions api/public/assets/bootstrap.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions api/public/assets/bootstrap.min.css.map

Large diffs are not rendered by default.

Binary file added api/public/assets/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/public/assets/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/public/assets/favicon.ico
Binary file not shown.
Binary file not shown.
288 changes: 288 additions & 0 deletions api/public/assets/glyphicons-halflings-regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
143 changes: 143 additions & 0 deletions api/public/assets/main.bundle.js

Large diffs are not rendered by default.

Loading

0 comments on commit 2a82db1

Please sign in to comment.