Skip to content

Commit

Permalink
feat(api): expose exchange rates api to client and temporary remove s…
Browse files Browse the repository at this point in the history
…ecret key check (#259)
  • Loading branch information
bkdev98 committed Sep 3, 2024
1 parent 1f28622 commit 02fa0ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions apps/api/v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import usersApp from './routes/users'
import walletsApp from './routes/wallets'

export const hono = new Hono()
.route('/exchange-rates', exchangeRatesApp)

.use('*', authMiddleware)

.route('/exchange-rates', exchangeRatesApp)

.route('/auth', authApp)
.route('/budgets', budgetsApp)
.route('/categories', categoriesApp)
Expand Down
15 changes: 8 additions & 7 deletions apps/api/v1/routes/exchange-rates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ import {
} from '../services/exchange-rates.service'

const router = new Hono()
.use(async (c, next) => {
const apiKey = c.req.header('x-api-key')
// TODO: Enable this later
// .use(async (c, next) => {
// const apiKey = c.req.header('x-api-key')

if (!apiKey || apiKey !== process.env.API_SECRET_KEY) {
return c.json({ message: 'Unauthorized' }, 401)
}
// if (!apiKey || apiKey !== process.env.API_SECRET_KEY) {
// return c.json({ message: 'Unauthorized' }, 401)
// }

await next()
})
// await next()
// })

.get(
'/',
Expand Down

0 comments on commit 02fa0ec

Please sign in to comment.