This commit is contained in:
2023-05-16 10:31:27 +02:00
parent 433fe035b9
commit 85862577b2
160 changed files with 268 additions and 202 deletions

View File

@@ -1,5 +1,5 @@
const express = require( 'express' );
const config = require( '../../nationchains/tribes/conf.json' );
const conf = require(`${process.env.dirtown}/conf.json`);
// Classes
const Nations = require( '../models/Nations.js' );
@@ -30,7 +30,7 @@ router.post( '/push', checkHeaders, ( req, res ) => {
// check req.body.hashnext => means this is a candidate to validate next block
//
// return it's own information back with the last call to Nationchains.synchronize()
res.send( { status: 200, payload: { moreinfo: fs.readFileSync( `${config.tribes}/${config.mayorId}/nationchains/nodes/${config.rootURL}`, 'utf-8' ) } } )
res.send( { status: 200, payload: { moreinfo: fs.readFileSync( `${conf.tribes}/${conf.mayorId}/nationchains/nodes/${conf.rootURL}`, 'utf-8' ) } } )
} )
router.get('/synchro',checkHeaders, isAuthenticated,(req,res)=>{

View File

@@ -2,7 +2,7 @@ const express = require("express");
const glob = require("glob");
const fs = require("fs-extra");
const path = require("path");
const conf = require("../../nationchains/tribes/conf.json");
const conf = require(`${process.env.dirtown}/conf.json`);
const Odmdb = require("../models/Odmdb.js");
// Middlewares
const checkHeaders = require("../middlewares/checkHeaders");
@@ -165,7 +165,7 @@ router.put("schema/:objectname", checkHeaders, isAuthenticated, (req, res) => {
*
* @apiParam {String} objectname Mandatory if headers.xworkon == nationchains then into ./nationchains/ else into ./tribes/xworkon/
* @apiBody {string} schemapath where to store schema .../schema
* @apiBody {string} objectpath where to store object ...objectname/idx/config.json
* @apiBody {string} objectpath where to store object ...objectname/idx/conf.json
* @apiBody {json} schema content
* @apiBody {json} schemalang content in lg
* @apiBody {string} lang define which schemalg is (2 letters)

View File

@@ -1,7 +1,7 @@
const express = require( 'express' );
const fs = require( 'fs-extra' );
const path = require( 'path' );
const conf=require('../../nationchains/tribes/conf.json')
const conf = require(`${process.env.dirtown}/conf.json`);
// Classes
const Tribes = require( '../models/Tribes.js' );