Skip to content

Commit

Permalink
added readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-vaibhav committed Oct 15, 2023
1 parent dfde752 commit 9bb430e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# trybackroad
# Try Backroad

A simple starter for trying out backroad

Use the following commands to get started:

```bash
git clone https://github.com/sudomakes/trybackroad
cd trybackroad
npm install
npm run dev
```

## Links

website: [backroad.sudomakes.art](https://backroad.sudomakes.art)
github: [backroad](https://github.com/sudomakes/backroad)
26 changes: 0 additions & 26 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { run } from "@backroad/backroad";
run(async (br) => {
const repoData = br.getOrDefault(
"repo-data",
null as null | { stars: number; latestVersion: string }
);
br.write({
body: `# 🛣️ Welcome to Backroad
This is a quick start template to help you get started developing backroad apps. You can also checkout the examples on [stackblitz](https://stackblitz.com/@sudo-vaibhav/collections/backroad)`,
Expand Down Expand Up @@ -43,26 +39,4 @@ This is a quick start template to help you get started developing backroad apps.
---
Backroad is currently in beta-development phase. If you like the idea behind it and would like to see it develop further. Please [consider starring Backroad on Github](https://github.com/sudomakes/backroad), or tell your developer friends about it. Thanks for trying backroad 💖`,
});
if (repoData === null) {
const [repo, tags] = await Promise.all(
(
await Promise.all([
fetch("https://api.github.com/repos/sudomakes/backroad"),
fetch("https://api.github.com/repos/sudomakes/backroad/tags"),
])
).map((resp) => resp.json())
);

br.setValue("repo-data", {
stars: repo.stargazers_count,
latestVersion: tags[0].name,
});
} else {
br.stats({
items: [
{ label: "Backroad Stars", value: repoData.stars },
{ label: "Latest Version", value: repoData.latestVersion },
],
});
}
});

0 comments on commit 9bb430e

Please sign in to comment.