Skip to content
Snippets Groups Projects
Commit a7a4e245 authored by James Calfee's avatar James Calfee
Browse files

Configurable image upload server url. #185

parent b2bb23e3
No related branches found
No related tags found
No related merge requests found
...@@ -350,7 +350,6 @@ function* lookupPreviousOwnerAuthority({payload: {}}) { ...@@ -350,7 +350,6 @@ function* lookupPreviousOwnerAuthority({payload: {}}) {
} }
import {Signature, hash} from 'shared/ecc' import {Signature, hash} from 'shared/ecc'
// import request from 'request'
function* uploadImageWatch() { function* uploadImageWatch() {
yield* takeLatest('user/UPLOAD_IMAGE', uploadImage); yield* takeLatest('user/UPLOAD_IMAGE', uploadImage);
...@@ -411,7 +410,7 @@ function* uploadImage({payload: {file, dataUrl, filename = 'image.txt', progress ...@@ -411,7 +410,7 @@ function* uploadImage({payload: {file, dataUrl, filename = 'image.txt', progress
} }
const sig = Signature.signBufferSha256(bufSha, d) const sig = Signature.signBufferSha256(bufSha, d)
const postUrl = `http://localhost:3234/${username}/${sig.toHex()}` const postUrl = `${$STM_Config.uploadImage}/${username}/${sig.toHex()}`
fetch(postUrl, { fetch(postUrl, {
method: 'post', method: 'post',
......
...@@ -20,7 +20,8 @@ global.$STM_Config = { ...@@ -20,7 +20,8 @@ global.$STM_Config = {
ipfs_prefix: config.ipfs_prefix, ipfs_prefix: config.ipfs_prefix,
disable_signups: config.disable_signups, disable_signups: config.disable_signups,
read_only_mode: config.read_only_mode, read_only_mode: config.read_only_mode,
registrar_fee: config.registrar.fee registrar_fee: config.registrar.fee,
uploadImage: config.uploadImage,
}; };
const WebpackIsomorphicTools = require('webpack-isomorphic-tools'); const WebpackIsomorphicTools = require('webpack-isomorphic-tools');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment