Skip to content

Commit dbe062d

Browse files
authored
Added endpoint for saving code. (#20)
* Update PROD endpoint to new AWS server. * Added pastebin endpoint; preparing to allow saving functionality.
1 parent 145e65c commit dbe062d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/App/App.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ import languages from '../resources/languages';
99
import './App.css';
1010

1111
// Backend servers to execute code.
12-
const DEV_POST_URL = 'http://localhost:5000/coderpad/execute'
13-
const PROD_POST_URL = 'https://aws.dannyhp.com/coderpad/execute'
14-
const POST_URL = PROD_POST_URL
12+
const EXECUTE_CODE_DEV_POST_URL = 'http://localhost:5000/coderpad/execute'
13+
const EXECUTE_CODE_PROD_POST_URL = 'https://aws.dannyhp.com/coderpad/execute'
14+
const EXECUTE_CODE_POST_URL = EXECUTE_CODE_PROD_POST_URL
15+
16+
// Backend servers to save code (Pastebin: https://github.com/dannyhp1/pastebin)
17+
const SAVE_CODE_DEV_POST_URL = 'http://localhost:5000/pastebin/save'
18+
const SAVE_CODE_PROD_POST_URL = 'https://aws.dannyhp.com/pastebin/save'
19+
const SAVE_CODE_POST_URL = SAVE_CODE_PROD_POST_URL
1520

1621
// Default settings on page loadup.
1722
const DEFAULT_LANGUAGE = 'python'
@@ -120,7 +125,7 @@ class App extends Component {
120125
executeCode = () => {
121126
this.setRunningStatus()
122127

123-
axios.post(POST_URL, {
128+
axios.post(EXECUTE_CODE_POST_URL, {
124129
language: this.state.language,
125130
code: this.state.source[this.state.language],
126131
}).then(response => {

0 commit comments

Comments
 (0)