Skip to content

Instantly share code, notes, and snippets.

@FlorianRappl
Created November 7, 2019 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FlorianRappl/4ffb13a0c590bc61c87b829912f1c971 to your computer and use it in GitHub Desktop.
Save FlorianRappl/4ffb13a0c590bc61c87b829912f1c971 to your computer and use it in GitHub Desktop.
import * as React from "react";
import { render } from "react-dom";
import { Redirect } from "react-router-dom";
import { createPiral, Piral, SetRoute } from "piral";
import { createContainerApi } from "piral-containers";
const piral = createPiral({
requestPilets() {
return fetch("https://feed.piral.io/api/v1/pilet/mife-demo")
.then(res => res.json())
.then(res => res.items);
},
extendApi: [createContainerApi()]
});
const app = (
<Piral instance={piral}>
<SetRedirect from="/" to="/products" />
</Piral>
);
render(app, document.querySelector("#app"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment