Skip to content

Commit 1b4a897

Browse files
committed
perf(readme): ✨ update README generation to include dynamic start URLs
1 parent 9d85081 commit 1b4a897

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

packages/create-vitnode-app/copy-of-vitnode-app/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ To get started, run the following commands:
2323
pnpm i
2424
```
2525

26-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
26+
Open {{START_URLS}} with your browser to see the result.
2727

2828
## Development
2929

30-
To start the development server, you need to create a `.env` file in the folder app from the provided `.env.example` file.
30+
To start the development server, you need to create a `.env` file from the provided `.env.example` file.
3131

3232
In the `development` environment, you can just copy and paste the content of `.env.example` to `.env`.
3333

packages/create-vitnode-app/src/create/create-vitnode.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,17 +284,16 @@ export const createVitNode = async ({
284284
let readmeContent = await readFile(join(root, "README.md"), "utf-8");
285285
readmeContent = readmeContent.replaceAll("pnpm", packageManager);
286286

287+
// Update README.md with start URLs
288+
let startUrlsText = "[http://localhost:3000](http://localhost:3000)";
287289
if (mode === "onlyApi") {
288-
readmeContent = readmeContent.replaceAll(
289-
"http://localhost:3000",
290-
"http://localhost:8080",
291-
);
290+
startUrlsText = "[http://localhost:8080](http://localhost:8080)";
292291
} else if (mode === "apiMonorepo") {
293-
readmeContent = readmeContent.replaceAll(
294-
"Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.",
295-
"Open [http://localhost:3000](http://localhost:3000) for the Web app and [http://localhost:8080](http://localhost:8080) for the API with your browser to see the result.",
296-
);
292+
startUrlsText =
293+
"[http://localhost:3000](http://localhost:3000) for the Web app and [http://localhost:8080](http://localhost:8080) for the API";
297294
}
295+
296+
readmeContent = readmeContent.replace("{{START_URLS}}", startUrlsText);
298297
await writeFile(join(root, "README.md"), readmeContent);
299298

300299
spinner.text = "Generating migrations...";

0 commit comments

Comments
 (0)