Skip to content

Commit

Permalink
add env example & update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
SaicharanKandukuri committed Aug 20, 2023
1 parent b47c157 commit 40aaecc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 23 deletions.
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
VITE_API_KEY=
VITE_AUTH_DOMAIN=
VITE_PROJECT_ID=
VITE_STORAGE_BUCKET=
VITE_MESSAGING_SENDER_ID=
VITE_APP_ID=
VITE_MEASUREMENT_ID=
47 changes: 24 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
# create-svelte
# install counter

Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
A simple firebase + svelte project to count udroid installations.

## Creating a project
## Working

If you're seeing this, you've probably already done this step. Congrats!
- Svelte is used to create simple server side functions to increment the counter and return the current count.
- vercel is used to deploy the serverless functions ( :heart: vercel )
- Firebase to store the count and serve

```bash
# create a new project in the current directory
npm create svelte@latest
## Endpoints

# create a new project in my-app
npm create svelte@latest my-app
```
|Endpoint| Description |
|--|--|
| `/count` | to increment the count and return the current count |
| `/cur_count` | to return the current count |

## Developing
> No extra parameters are required for the endpoints
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
## Usage

```bash
npm run dev
check out `.env.example` to create a `.env` file

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

## Building
```bash
curl https://endpoints-url/count
```

To create a production version of your app:
returns a json response

```bash
npm run build
```cmd
{"downloads":908}
```

You can preview the production build with `npm run preview`.
> Please don't spam the endpoints :pray:
## License

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
MIT

0 comments on commit 40aaecc

Please sign in to comment.