Skip to content

Commit 3a138f9

Browse files
update: move src directory into root directory
1 parent 83bcb2c commit 3a138f9

File tree

30 files changed

+32
-25
lines changed

30 files changed

+32
-25
lines changed

index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,8 @@ async function init() {
318318

319319
write("package.json", JSON.stringify(pkg, null, 2) + "\n");
320320
const ext = template.split("-")[1] ? "ts" : "js";
321-
let srcEntry = template.startsWith("vercel") ? "api/src" : "src";
322-
await setupSecret(root, `${srcEntry}/index.${ext}`, secret);
323-
await setupSubdomain(root, `${srcEntry}/DevLayer.js`);
321+
await setupSecret(root, `src/index.${ext}`, secret);
322+
await setupSubdomain(root, `src/DevLayer.js`);
324323
let doneMessage = "";
325324
const cdProjectName = path.relative(cwd, root);
326325
doneMessage += `All done! Execute:\n`;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "create-discord-https",
33
"description": "Create Discord.https-powered bots with one command.",
4-
"version": "2.0.15",
4+
"version": "2.0.16",
55
"bin": {
66
"create-discord-https": "index.js"
77
},

templates/vercel-ts/.vercelignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
/*
2-
!api
3-
!vercel.json
4-
!*.html
5-
!package.json

templates/vercel-ts/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
## Discord.https
22

3-
Vercel’s serverless functions must be placed inside the api directory, anything outside this directory will be served as a public asset.
3+
Vercel’s serverless functions must be placed inside the `api` directory. Anything outside this directory will be served as a public asset. Therefore, `vercel.json` is used to rewrite all requests to point to `api/interactions`, so that interactions will also resolve to `api/interactions`.
44

5-
By default, the URL is: `<vercel_url>/api/interactions`
5+
By default, the URL is: `<vercel_url>/interactions`
66

77
More details:
88

9-
* [Vercel](https://vercel.com)
10-
* [Vercel Functions Documentation](https://vercel.com/docs/functions)
9+
- [Vercel](https://vercel.com)
10+
- [Vercel Functions Documentation](https://vercel.com/docs/functions)
1111

1212
### How to deploy
1313

@@ -29,4 +29,4 @@ npm run dev
2929

3030
For more information, view `DevLayer.ts` or, `DevLayer.js`
3131

32-
You don’t need a separate TypeScript build step—Vercel handles it automatically.
32+
You don’t need a separate TypeScript build step—Vercel handles it automatically.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import client from "./src/index.js";
1+
import client from "../src/index.js";
22
import type { VercelRequest, VercelResponse } from "@vercel/node";
33
export default async function handler(req: VercelRequest, res: VercelResponse) {
4-
return await client.listen("api/interactions", req, res);
4+
return await client.listen("interactions", req, res);
55
}
File renamed without changes.

0 commit comments

Comments
 (0)