Skip to content

Commit 7850798

Browse files
Zo-Bro-23DPS0340
authored andcommitted
Add option to deploy using other services (anuraghazra#2525)
* Create express.js * Update readme.md * Update readme.md
1 parent 336cd68 commit 7850798

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

Diff for: express.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import statsCard from './api/index.js'
2+
import repoCard from './api/pin.js'
3+
import langCard from './api/top-langs.js'
4+
import wakatimeCard from './api/wakatime.js'
5+
import express from 'express'
6+
import dotenv from 'dotenv'
7+
8+
dotenv.config()
9+
const app = express()
10+
app.listen(process.env.port || 9000)
11+
12+
app.get('/', statsCard)
13+
app.get('/pin', repoCard)
14+
app.get('/top-langs', langCard)
15+
app.get('/wakatime', wakatimeCard)

Diff for: readme.md

+23-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ Visit <https://indiafightscorona.giveindia.org> and make a small donation to hel
9292
- [Repo Card Exclusive Options](#repo-card-exclusive-options)
9393
- [Language Card Exclusive Options](#language-card-exclusive-options)
9494
- [Wakatime Card Exclusive Option](#wakatime-card-exclusive-options)
95-
- [Deploy Yourself](#deploy-on-your-own-vercel-instance)
95+
- [Deploy Yourself](#deploy-on-your-own)
96+
- [On Vercel](#on-vercel)
97+
- [On other platforms](#on-other-platforms)
9698
- [Keep your fork up to date](#keep-your-fork-up-to-date)
9799

98100
# GitHub Stats Card
@@ -509,7 +511,9 @@ By default, GitHub does not lay out the cards side by side. To do that, you can
509511
</a>
510512
```
511513

512-
## Deploy on your own Vercel instance
514+
## Deploy on your own
515+
516+
### On Vercel
513517

514518
#### :film_projector: [Check Out Step By Step Video Tutorial By @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107)
515519

@@ -546,6 +550,23 @@ Since the GitHub API only allows 5k requests per hour, my `https://github-readme
546550

547551
</details>
548552

553+
### On other platforms
554+
555+
> **Warning**
556+
> This way of using GRS is not officially supported and was added to cater to some particular use cases where Vercel could not be used (e.g. #2341). The support for this method, therefore, is limited.
557+
558+
<details>
559+
<summary><b>:hammer_and_wrench: Step-by-step guide for deploying on other platforms</b></summary>
560+
561+
1. Fork or clone this repo as per your needs
562+
2. Add `express` to the dependencies section of `package.json`
563+
https://github.com/anuraghazra/github-readme-stats/blob/ba7c2f8b55eac8452e479c8bd38b044d204d0424/package.json#L54-L61
564+
3. Run `npm i` if needed (initial setup)
565+
4. Run `node express.js` to start the server, or set the entry point to `express.js` in `package.json` if you're deploying on a managed service
566+
https://github.com/anuraghazra/github-readme-stats/blob/ba7c2f8b55eac8452e479c8bd38b044d204d0424/package.json#L11
567+
5. You're done 🎉
568+
</details>
569+
549570
### Keep your fork up to date
550571

551572
You can keep your fork, and thus your private Vercel instance up to date with the upstream using GitHubs' [Sync Fork button](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork). You can also use the [pull](https://github.com/wei/pull) package created by [@wei](https://github.com/wei) to automate this process.

0 commit comments

Comments
 (0)