Added server/api url

This commit is contained in:
MrFry 2020-03-17 17:54:58 +01:00
parent 49753aa113
commit 4d3f3c0cc4
7 changed files with 19 additions and 5 deletions

View file

@ -1,3 +1,5 @@
// TODO: add number next to it
export default function SubjectSelector (props) { export default function SubjectSelector (props) {
const { activeSubjName, searchTerm, data, onSubjSelect } = props const { activeSubjName, searchTerm, data, onSubjSelect } = props

View file

@ -1,4 +1,5 @@
{ {
"serverUrl": "http://api.frylabs.net/", "apiUrl": "http://api.frylabs.net/",
"serverUrl": "http://qmining.frylabs.net/",
"mobileWindowWidth": 700 "mobileWindowWidth": 700
} }

View file

@ -14,7 +14,7 @@ export default function AllQuestions (props) {
useEffect(() => { useEffect(() => {
console.info('Fetching data') console.info('Fetching data')
fetch(`${constants.serverUrl}data.json`) fetch(`${constants.apiUrl}data.json`)
.then((resp) => { .then((resp) => {
return resp.json() return resp.json()
}) })

View file

@ -5,7 +5,7 @@ export default function Feedback (props) {
// TODO: response to user that msg is sucessfully sent // TODO: response to user that msg is sucessfully sent
return ( return (
<div> <div>
<form action={constants.serverUrl + 'postfeedback'} method='post'> <form action={constants.apiUrl + 'postfeedback'} method='post'>
<div>Észrevételek: (közeledő teszt miatti kérdés-karbantartás, bug, feature vagy egyéb dolog, ami nyomja a lelked)</div> <div>Észrevételek: (közeledő teszt miatti kérdés-karbantartás, bug, feature vagy egyéb dolog, ami nyomja a lelked)</div>
<textarea <textarea
className='feedbackArea' className='feedbackArea'

View file

@ -14,7 +14,7 @@ export default function Index (props) {
useEffect(() => { useEffect(() => {
console.info('Fetching data') console.info('Fetching data')
fetch(`${constants.serverUrl}motd`) fetch(`${constants.apiUrl}motd`)
.then((resp) => { .then((resp) => {
return resp.text() return resp.text()
}) })

11
src/pages/thanks.js Normal file
View file

@ -0,0 +1,11 @@
// TODO: prettier page for donate
export default function Thanks () {
return (
<div>
<center>
<span>Thanks for the donate</span>
</center>
</div>
)
}

View file

@ -9,7 +9,7 @@ export default function UserQuestions (props) {
useEffect(() => { useEffect(() => {
console.info('Fetching qa.json') console.info('Fetching qa.json')
fetch(`${constants.serverUrl}qa.json`) // eslint-disable-line fetch(`${constants.apiUrl}qa.json`) // eslint-disable-line
.then((resp) => { .then((resp) => {
return resp.json() return resp.json()
}) })