Skip to content

Commit

Permalink
refactored code.
Browse files Browse the repository at this point in the history
  • Loading branch information
sakibcy committed Jul 12, 2024
1 parent 81d6b09 commit 7eb3358
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
9 changes: 0 additions & 9 deletions src/routes/entry.ts

This file was deleted.

16 changes: 7 additions & 9 deletions src/startup/routes.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
import { NextHandleFunction } from "connect";
import express from "express";
var cookieParser = require('cookie-parser')


import v2_languages from "../routes/v2_languages";
import v3_languages from "../routes/v3_languages";
import summarizer from "../routes/summarizer";
import v3_translate from "../routes/v3_translate";
import entry from "../routes/entry";
import authRoutes from "../routes/authRoutes";
import { requireAuth } from "../middleware/authMiddleware";
import { API_VERSION } from "../config";

module.exports = function (app: any) {
// @ts-ignore
app.use(express.json()) // for parsing application/json
app.use(express.urlencoded({extended: true})) // for parsing application/x-www-form-urlencoded
app.use(cookieParser());
const middleware = [
express.json(),
express.urlencoded({extended: true}),
require('cookie-parser')()
]

app.use(middleware);

app.use(`/${API_VERSION}/languagesv2`, v2_languages);
app.use(`/${API_VERSION}/languages`, v3_languages);
Expand Down

0 comments on commit 7eb3358

Please sign in to comment.