fix some shit

This commit is contained in:
ntr 2019-06-17 19:50:09 +10:00
parent e74c820ce4
commit 27864aa9fc
3 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
const toast = require('izitoast'); const toast = require('izitoast');
const cbor = require('borc'); const cbor = require('borc');
const SOCKET_URL = process.env.NODE_ENV === 'production' ? 'wss://mnml.gg/ws' : 'ws://localhost:40000/api/ws'; const SOCKET_URL = process.env.NODE_ENV === 'production' ? 'wss://mnml.gg/api/ws' : 'ws://localhost:40000/api/ws';
function errorToast(err) { function errorToast(err) {
console.error(err); console.error(err);

View File

@ -345,7 +345,7 @@ const TARGET_COLOURS = {
BROWN: '#583108', BROWN: '#583108',
}; };
const SERVER = process.env.NODE_ENV === 'production' ? '/' : 'http://localhost:40000'; const SERVER = process.env.NODE_ENV === 'production' ? '/api/' : 'http://localhost:40000/api';
function postData(url = '/', data = {}) { function postData(url = '/', data = {}) {
// Default options are marked with * // Default options are marked with *
return fetch(`${SERVER}${url}`, { return fetch(`${SERVER}${url}`, {

View File

@ -165,7 +165,7 @@ pub fn start() {
.service(web::resource("/api/payments/stripe").route(web::post().to(stripe_payment))) .service(web::resource("/api/payments/stripe").route(web::post().to(stripe_payment)))
.service(web::resource("/api/payments/crypto").route(web::post().to(stripe_payment))) .service(web::resource("/api/payments/crypto").route(web::post().to(stripe_payment)))
.service(web::resource("/api/ws/").route(web::get().to(connect)))) .service(web::resource("/api/ws").route(web::get().to(connect))))
.bind("127.0.0.1:40000").expect("could not bind to port") .bind("127.0.0.1:40000").expect("could not bind to port")
.run().expect("could not start http server"); .run().expect("could not start http server");
} }