From 9bb430e7c80217281a2245483235fe3ba066dcc8 Mon Sep 17 00:00:00 2001 From: sudo-vaibhav Date: Mon, 16 Oct 2023 02:16:56 +0530 Subject: [PATCH] added readme --- README.md | 18 +++++++++++++++++- src/main.ts | 26 -------------------------- 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index c48dc5a..e10a85b 100644 --- a/README.md +++ b/README.md @@ -1 +1,17 @@ -# trybackroad \ No newline at end of file +# 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) diff --git a/src/main.ts b/src/main.ts index a4e795b..d586134 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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)`, @@ -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 }, - ], - }); - } });