Separated pay, claim, and change wallet addresses #44
4 changed files with 15 additions and 10 deletions
|
@ -8,7 +8,7 @@ module.exports = {
|
||||||
// const payAddress = config.get('WalletConfig.LbryPayAddress');
|
// const payAddress = config.get('WalletConfig.LbryPayAddress');
|
||||||
const claimAddress = config.get('WalletConfig.LbryClaimAddress');
|
const claimAddress = config.get('WalletConfig.LbryClaimAddress');
|
||||||
// const changeAddress = config.get('WalletConfig.LbryChangeAddress');
|
// const changeAddress = config.get('WalletConfig.LbryChangeAddress');
|
||||||
// ensure nsfw is a boolean
|
// filter nsfw and ensure it is a boolean
|
||||||
if (nsfw === false) {
|
if (nsfw === false) {
|
||||||
nsfw = false;
|
nsfw = false;
|
||||||
} else if (nsfw.toLowerCase === 'false') {
|
} else if (nsfw.toLowerCase === 'false') {
|
||||||
|
|
|
@ -3,8 +3,9 @@ const { postToAnalytics } = require('../helpers/libraries/analytics');
|
||||||
|
|
||||||
module.exports = app => {
|
module.exports = app => {
|
||||||
// route for the home page
|
// route for the home page
|
||||||
app.get('/', ({ originalUrl, ip }, res) => {
|
app.get('/', ({ originalUrl, ip, headers }, res) => {
|
||||||
logger.debug(`GET request on ${originalUrl} from ${ip}`);
|
logger.verbose(`GET request on ${originalUrl} from ${ip}`);
|
||||||
|
logger.debug(`headers ${JSON.stringify(headers)}`);
|
||||||
res.status(200).render('index');
|
res.status(200).render('index');
|
||||||
});
|
});
|
||||||
// a catch-all route if someone visits a page that does not exist
|
// a catch-all route if someone visits a page that does not exist
|
||||||
|
|
|
@ -34,9 +34,10 @@ function serveFile ({ fileName, fileType, filePath }, res) {
|
||||||
|
|
||||||
module.exports = (app) => {
|
module.exports = (app) => {
|
||||||
// route to fetch one free public claim
|
// route to fetch one free public claim
|
||||||
app.get('/:name/:claim_id', ({ originalUrl, params, ips, headers }, res) => {
|
app.get('/:name/:claim_id', ({ originalUrl, params, ip, ips, headers }, res) => {
|
||||||
logger.debug(`GET request on ${originalUrl} from ${ips}`);
|
logger.verbose(`GET request on ${originalUrl} from ${ip}`);
|
||||||
logger.debug(`headers ${headers}`);
|
logger.debug(`ips >> ${JSON.stringify(ips)}`);
|
||||||
|
logger.debug(`headers >> ${JSON.stringify(headers)}`);
|
||||||
// begin image-serve processes
|
// begin image-serve processes
|
||||||
serveController
|
serveController
|
||||||
.getClaimByClaimId(params.name, params.claim_id)
|
.getClaimByClaimId(params.name, params.claim_id)
|
||||||
|
@ -49,9 +50,10 @@ module.exports = (app) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
// route to fetch one free public claim
|
// route to fetch one free public claim
|
||||||
app.get('/:name', ({ originalUrl, params, ips, headers }, res) => {
|
app.get('/:name', ({ originalUrl, params, ip, ips, headers }, res) => {
|
||||||
logger.debug(`GET request on ${originalUrl} from ${ips}`);
|
logger.verbose(`GET request on ${originalUrl} from ${ip}`);
|
||||||
logger.debug(`headers ${headers}`);
|
logger.debug(`ips >> ${JSON.stringify(ips)}`);
|
||||||
|
logger.debug(`headers >> ${JSON.stringify(headers)}`);
|
||||||
// begin image-serve processes
|
// begin image-serve processes
|
||||||
serveController
|
serveController
|
||||||
.getClaimByName(params.name)
|
.getClaimByName(params.name)
|
||||||
|
|
|
@ -25,6 +25,7 @@ const db = require('./models');
|
||||||
app.use(express.static(`${__dirname}/public`));
|
app.use(express.static(`${__dirname}/public`));
|
||||||
|
|
||||||
// configure express app
|
// configure express app
|
||||||
|
app.enable('trust proxy'); // trust the proxy to get ip address for us
|
||||||
app.use(bodyParser.json()); // for parsing application/json
|
app.use(bodyParser.json()); // for parsing application/json
|
||||||
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
|
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
|
||||||
app.use(siofu.router);
|
app.use(siofu.router);
|
||||||
|
@ -68,6 +69,7 @@ const http = require('./routes/sockets-routes.js')(app, siofu, hostedContentPath
|
||||||
// start server
|
// start server
|
||||||
db.sequelize.sync().then(() => {
|
db.sequelize.sync().then(() => {
|
||||||
http.listen(PORT, () => {
|
http.listen(PORT, () => {
|
||||||
|
winston.info('Trusting proxy?', app.get('trust proxy'));
|
||||||
winston.info(`Server is listening on PORT ${PORT}`);
|
winston.info(`Server is listening on PORT ${PORT}`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue