-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(image/src): simplify route handling and type usage
test(type-url.test.ts): add HEAD method tests for json and image refactor(utils/types.ts): rename IPFSResponseType to ResponseType
- Loading branch information
Showing
5 changed files
with
42 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
import { Hono } from 'hono' | ||
import { cors } from 'hono/cors' | ||
|
||
import { Env } from './utils/constants' | ||
import { allowedOrigin } from './utils/cors' | ||
import { getTypeUrl } from './routes/type-url' | ||
import typeUrlRoute from './routes/type-url' | ||
import ipfsRoute from './routes/ipfs' | ||
|
||
const app = new Hono<{ Bindings: Env }>() | ||
|
||
app.get('/', (c) => c.text('Hello! cf-workers!')) | ||
|
||
app.route('/ipfs', ipfsRoute) | ||
|
||
app.use('/type/url', cors({ origin: allowedOrigin })) | ||
app.on(['GET', 'HEAD'], '/type/url', getTypeUrl) | ||
app.route('/type/url', typeUrlRoute) | ||
|
||
export default app |
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