feat(about): Adding npm version to JSON RPC About endpoint output

This commit is contained in:
Chris Troutner
2021-08-03 13:05:45 -07:00
parent fde8b16fef
commit 72ac73c410
4 changed files with 25 additions and 23 deletions
-15
View File
@@ -1,15 +0,0 @@
/*
This file should be customized for your app. The string in this file is
displayed when a user makes the 'about' JSON RPC call.
*/
module.exports = `
This is the about string for the ipfs-service-provider repository:
https://github.com/Permissionless-Software-Foundation/ipfs-service-provider
Brought to you by the Permissionless Software Foundation:
https://PSFoundation.cash
Documentation:
https://ipfs-service-provider.fullstack.cash/
`
+21 -5
View File
@@ -5,6 +5,14 @@
/* eslint no-unneeded-ternary:0 */
// Get the version from the package.json file.
const pkgInfo = require('../../package.json')
const version = pkgInfo.version
const ipfsCoordName = process.env.COORD_NAME
? process.env.COORD_NAME
: 'ipfs-bch-wallet-service'
module.exports = {
// Configure TCP port.
port: process.env.PORT || 5001,
@@ -13,9 +21,15 @@ module.exports = {
logPass: 'test',
// Email server settings if nodemailer email notifications are used.
emailServer: process.env.EMAILSERVER ? process.env.EMAILSERVER : 'mail.someserver.com',
emailUser: process.env.EMAILUSER ? process.env.EMAILUSER : 'noreply@someserver.com',
emailPassword: process.env.EMAILPASS ? process.env.EMAILPASS : 'emailpassword',
emailServer: process.env.EMAILSERVER
? process.env.EMAILSERVER
: 'mail.someserver.com',
emailUser: process.env.EMAILUSER
? process.env.EMAILUSER
: 'noreply@someserver.com',
emailPassword: process.env.EMAILPASS
? process.env.EMAILPASS
: 'emailpassword',
// IPFS settings.
isCircuitRelay: process.env.ENABLE_CIRCUIT_RELAY ? true : false,
@@ -27,8 +41,10 @@ module.exports = {
announceJsonLd: {
'@context': 'https://schema.org/',
'@type': 'WebAPI',
name: 'ipfs-service-provider',
description: 'This is a generic IPFS Serivice Provider that uses JSON RPC over IPFS to communicate with it. This instance has not been customized. Source code: https://github.com/Permissionless-Software-Foundation/ipfs-service-provider',
name: ipfsCoordName,
version,
description:
'This is a generic IPFS Serivice Provider that uses JSON RPC over IPFS to communicate with it. This instance has not been customized. Source code: https://github.com/Permissionless-Software-Foundation/ipfs-service-provider',
documentation: 'https://ipfs-service-provider.fullstack.cash/',
provider: {
'@type': 'Organization',
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ipfs-service-provider",
"version": "1.0.0",
"version": "1.3.0",
"description": "A Koa-based combination of a REST API and IPFS JSON RPC. Boilerplate for starting new projects.",
"main": "index.js",
"scripts": {
+3 -2
View File
@@ -6,7 +6,7 @@
const jsonrpc = require('jsonrpc-lite')
// Local libraries
const aboutStr = require('../../../../config/about')
const config = require('../../../../config')
class AboutRPC {
constructor (localConfig) {
@@ -36,7 +36,8 @@ class AboutRPC {
return {
success: true,
status: 200,
message: aboutStr,
// message: aboutStr,
message: JSON.stringify(config.announceJsonLd),
endpoint: 'about'
}
}