mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-08 12:57:46 +00:00
Adds manifest.json to examples folder (#3536)
* Revert "Revert "[examples] Add manifest.json"" This reverts commitc65336e63b. * Revert "Revert "Do not use now-examples anymore"" This reverts commitac72e944a7. * Update nowignore * Fix join * Fix JSON * Fix header * Replace manifest.json with @now/frameworks * Adjust readmes * Adjust .nowignore * Update scully * Fix description * Update examples/create-react-app/src/App.js Co-Authored-By: Shu Ding <ds303077135@gmail.com> * Update readme * Add websites * Use https * Adjust example URL * Change order Co-authored-by: Shu Ding <ds303077135@gmail.com>
This commit is contained in:
@@ -1,25 +1,56 @@
|
||||
import React from 'react';
|
||||
import logo from './logo.svg';
|
||||
import { useEffect, useState } from 'react';
|
||||
import './App.css';
|
||||
|
||||
function App() {
|
||||
const [date, setDate] = useState(null);
|
||||
useEffect(() => {
|
||||
async function getDate() {
|
||||
const res = await fetch('/api/date');
|
||||
const newDate = await res.text();
|
||||
setDate(newDate);
|
||||
}
|
||||
getDate();
|
||||
}, []);
|
||||
return (
|
||||
<div className="App">
|
||||
<header className="App-header">
|
||||
<img src={logo} className="App-logo" alt="logo" />
|
||||
<p>
|
||||
Edit <code>src/App.js</code> and save to reload.
|
||||
</p>
|
||||
<main>
|
||||
<h1>Create React App + Go API</h1>
|
||||
<h2>
|
||||
Deployed with{' '}
|
||||
<a
|
||||
className="App-link"
|
||||
href="https://reactjs.org"
|
||||
href="https://zeit.co/docs"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
Learn React
|
||||
ZEIT Now
|
||||
</a>
|
||||
</header>
|
||||
</div>
|
||||
!
|
||||
</h2>
|
||||
<p>
|
||||
<a
|
||||
href="https://github.com/zeit/now-examples/tree/master/create-react-app"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
This project
|
||||
</a>{' '}
|
||||
was bootstrapped with{' '}
|
||||
<a href="https://facebook.github.io/create-react-app/">
|
||||
Create React App
|
||||
</a>{' '}
|
||||
and contains three directories, <code>/public</code> for static assets,{' '}
|
||||
<code>/src</code> for components and content, and <code>/api</code>{' '}
|
||||
which contains a serverless <a href="https://golang.org/">Go</a>{' '}
|
||||
function. See{' '}
|
||||
<a href="/api/date">
|
||||
<code>api/date</code> for the Date API with Go
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
<br />
|
||||
<h2>The date according to Go is:</h2>
|
||||
<p>{date ? date : 'Loading date...'}</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user