
Overview
I published the GitHub repository for the API introduced in the following article.
The repository is below.
https://github.com/nakamura196/dts-typescript
There may be some incomplete aspects, but I hope this is helpful as a reference.
Notes
Vercel Rewrite
By configuring as follows, access to / was redirected to /api/dts.
{
"version": 2,
"builds": [
{
"src": "src/index.ts",
"use": "@vercel/node"
}
],
"rewrites": [
{
"source": "/api/dts(.*)",
"destination": "/src/index.ts"
}
],
"redirects": [
{
"source": "/",
"destination": "/api/dts",
"permanent": true
}
]
}
Collection ID
The following is used as the collection ID.
const COLLECTION_ID = "urn:kouigenjimonogatari";
Initially, I did not include the urn: prefix, but when using the following MyCapytain library, without the urn: prefix, a / was inserted, which caused issues.
https://github.com/Capitains/MyCapytain
Summary
There are many incomplete implementations, but I hope this is helpful as a reference.