Last active
May 29, 2019 05:27
-
-
Save seanpmaxwell/b09d1876245f982fbe92c6153b04ee22 to your computer and use it in GitHub Desktop.
TypeScriptFullStackShell/src/public/react/demo-react/src/App.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
class App extends Component { | |
render() { | |
async function callExpress() { | |
try { | |
let response = await fetch('/api/say-hello/SeanMaxwell') | |
.then(res => res.json()); | |
alert('Hi this is a response from the backend: ' + response.response); | |
} catch (err) { | |
alert(err); | |
} | |
} | |
callExpress(); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment