1
0
mirror of https://github.com/oceanprotocol/community-numbers.git synced 2024-11-25 03:20:17 +01:00
community-numbers/README.md

114 lines
2.7 KiB
Markdown
Raw Normal View History

2019-05-14 20:52:48 +02:00
[![banner](https://raw.githubusercontent.com/oceanprotocol/art/master/github/repo-banner%402x.png)](https://oceanprotocol.com)
<h1 align="center">community-numbers</h1>
> Microservice to cache and expose community numbers for use throughout [oceanprotocol.com](https://oceanprotocol.com).
2021-02-04 14:00:06 +01:00
[![Build Status](https://travis-ci.com/oceanprotocol/community-numbers.svg?branch=main)](https://travis-ci.com/oceanprotocol/community-numbers)
2019-05-14 20:52:48 +02:00
[![js oceanprotocol](https://img.shields.io/badge/js-oceanprotocol-7b1173.svg)](https://github.com/oceanprotocol/eslint-config-oceanprotocol)
<img src="http://forthebadge.com/images/badges/powered-by-electricity.svg" height="20"/>
<img src="http://forthebadge.com/images/badges/as-seen-on-tv.svg" height="20"/>
<img src="http://forthebadge.com/images/badges/uses-badges.svg" height="20"/>
## API
Endpoint: [`https://oceanprotocol-community.now.sh`](https://oceanprotocol-community.now.sh)
2019-06-06 20:27:01 +02:00
### `GET /`
2019-05-14 20:52:48 +02:00
**200**: Returns a list of network numbers as follows:
```json
{
2020-06-16 12:32:47 +02:00
"github": {
"stars": 1000,
"repos": 1000
},
"medium": {
"followers": 1000
},
"bounties": {
"open": 1000,
"total": 1000
},
"twitter": {
"followers": 1000
},
"telegram": {
"community": 1000,
"news": 1000
},
"discord": {
"members": 1000
}
2019-05-14 20:52:48 +02:00
}
```
## Development
Install dependencies:
```bash
2020-06-16 09:38:10 +02:00
npm install -g vercel
2019-05-14 20:52:48 +02:00
npm install
```
And run the server in dev mode:
2019-05-14 20:52:48 +02:00
```bash
npm start
```
2021-02-04 14:00:06 +01:00
Then either open up `http://localhost:3000` in a browser or do in another Terminal:
2021-02-03 11:18:49 +01:00
```
2021-02-04 14:00:06 +01:00
curl http://localhost:3000
2021-02-03 11:18:49 +01:00
```
2019-05-14 20:52:48 +02:00
## Test
Run the tests:
```bash
npm test
```
## Deployment
2021-02-04 14:00:06 +01:00
Every branch is automatically deployed to [Vercel](https://vercel.com) with their GitHub integration. A link to a deployment will appear under each Pull Request.
2019-06-06 20:27:01 +02:00
2021-02-04 14:00:06 +01:00
The latest deployment of the `main` branch is automatically aliased to `oceanprotocol-community.now.sh`.
2019-06-06 20:27:01 +02:00
### Manual Deployment
If needed, app can be deployed manually. Make sure to switch to Ocean Protocol org before deploying:
2019-05-14 20:52:48 +02:00
```bash
# first run
2021-02-04 14:00:06 +01:00
vercel login
vercel switch
2019-05-14 20:52:48 +02:00
# deploy
2021-02-04 14:00:06 +01:00
vercel
2019-05-14 20:52:48 +02:00
# switch alias to new deployment
2021-02-04 14:00:06 +01:00
vercel alias
2019-05-14 20:52:48 +02:00
```
2019-06-06 20:27:01 +02:00
## License
```text
2021-01-05 10:28:24 +01:00
Copyright 2021 Ocean Protocol Foundation Ltd.
2019-06-06 20:27:01 +02:00
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```