{"size": 1221, "ext": "js", "max_stars_repo_path": "resources/js/homepage/App.js", "max_stars_repo_name": "crash963/Gifter", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "resources/js/homepage/App.js", "max_issues_repo_name": "crash963/Gifter", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "resources/js/homepage/App.js", "max_forks_repo_name": "crash963/Gifter", "max_forks_repo_forks_event_min_datetime": "2021-03-19T16:17:41.000Z", "max_forks_repo_forks_event_max_datetime": "2021-03-28T20:51:17.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 29.0714285714, "max_line_length": 70, "alphanum_fraction": 0.5225225225}
import "./App.css";
import Welcome from "./pages/welcome/welcome.jsx";
import { BrowserRouter, Switch, Route, Link } from "react-router-dom";
import Profile from "./pages/profile/Profile";

function App() {
    async function register() {
        let request_data = {
            nickname: "Slavo",
            email: "slavo@kozar.sk",
            password: "secretSecret",
            password_confirmation: "secretSecret",
        };

        const response = await fetch("/register", {
            method: "POST",
            body: JSON.stringify(request_data),
            headers: {
                Accept: "application/json",
                "Content-type": "application/json",
                "X-CSRF-TOKEN": document
                    .querySelector('meta[name="csrf-token"]')
                    .getAttribute("content"),
            },
        });
        const response_data = await response.json();

        console.log(response_data);
    }

    return (
        <BrowserRouter>
            <Switch>
                <Route exact path="/" children={<Welcome />} />
                <Route path="/profile" children={<Profile />} />
            </Switch>
        </BrowserRouter>
    );
}

export default App;
