Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ldarren/xin-node
xin api server
https://github.com/ldarren/xin-node
Last synced: about 2 months ago
JSON representation
xin api server
- Host: GitHub
- URL: https://github.com/ldarren/xin-node
- Owner: ldarren
- License: mit
- Created: 2019-02-16T17:57:26.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-10T20:13:33.000Z (almost 2 years ago)
- Last Synced: 2024-04-16T17:51:44.248Z (10 months ago)
- Language: JavaScript
- Size: 44.9 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xin-node
Kloud Konsole Xin service api server## setup
after cloning the project do a```
npm ci
```to install the dependencies
xin service has following main dependencies
- pico-api
- mysql database
- AWS cognito service## setup config
xin-node is powered by [pico-api](https://github.com/ldarren/pico-api), and hence they shared the same configuration format.create a configuration file as below, and save it to `cfg/xin.json`
```json
{
"app":{
"signalTTL": 60000,
"master": true,
"apis": [
"api/index.json"
],
"models": [
"models/index.js"
]
},
"mods":{
"webServer":{
"mod":"web",
"allowOrigin":"*",
"sep":["&"],
"uploadWL":[],
"port":8888
},
"storage1":{
"mod":"picos-mod-mysql",
"master": {
"host": "{MAIN_DB_DOMAIN}",
"port": {MAIN_DB_PORT},
"user": "{MAIN_DB_USER}",
"password": "{MAIN_DB_PASS}",
"database": "{MAIN_DB_NAME}",
"acquireTimeout": 120000,
"waitForConnections": true,
"connectionLimit": 2,
"queueLimit": 99
}
},
"storage2":{
"mod":"picos-mod-mysql",
"master": {
"host": "{SEC_DB_DOMAIN}",
"port": {SEC_DB_PORT},
"user": "{SEC_DB_USER}",
"password": "{SEC_DB_PASS}",
"database": "{SEC_DB_NAME}",
"acquireTimeout": 120000,
"waitForConnections": true,
"connectionLimit": 2,
"queueLimit": 99
}
}
}
}
```### setup sql database
update `cfg/xin.json` with your database configuration, after that execute `cfg/table.sql` to main and secondary databases
```sql
mysql -u{username} -p < cfg/table.sql
```after that, update `cfg/app.kloudkonsole.env.json` with the cognito setting then run:
```
npm run migrate
```
to populate required data to the main and secondary databases### setup cognito
download jwks setting from AWS cognito, with following url, replace the string in `{}`
```
wget https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/jwks.json
```keep the jwks.json in `cfg/` and add the path in `xin.dev.json`