-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomponent---src-pages-using-ssr-js-4265c341f77a2d6acdf5.js.map
1 lines (1 loc) · 2.08 KB
/
component---src-pages-using-ssr-js-4265c341f77a2d6acdf5.js.map
1
{"version":3,"file":"component---src-pages-using-ssr-js-4265c341f77a2d6acdf5.js","mappings":"uLAmCA,UA7BiB,SAAC,GAAoB,IAAlBA,EAAiB,EAAjBA,WAClB,OACE,gBAAC,IAAD,KACE,gBAAC,IAAD,CAAKC,MAAM,cACX,0CACe,kDAEf,4IAE+C,IAC7C,qEAHF,KAKA,uBACEC,MAAO,CAAEC,MAAO,QAASC,aAAc,wBACvCC,IAAI,eACJC,IAAKN,EAAWO,UAElB,2DACkC,IAChC,qBAAGC,KAAK,oFAAR,6CAFF,KAOA,gBAAC,EAAAC,KAAD,CAAMC,GAAG,KAAT","sources":["webpack://gatsby-starter-default/./src/pages/using-ssr.js"],"sourcesContent":["import * as React from \"react\"\r\nimport { Link } from \"gatsby\"\r\n\r\nimport Layout from \"../components/layout\"\r\nimport Seo from \"../components/seo\"\r\n\r\nconst UsingSSR = ({ serverData }) => {\r\n return (\r\n <Layout>\r\n <Seo title=\"Using SSR\" />\r\n <h1>\r\n This page is <b>rendered server-side</b>\r\n </h1>\r\n <p>\r\n This page is rendered server side every time the page is requested.\r\n Reload it to see a(nother) random photo from{\" \"}\r\n <code>dog.ceo/api/breed/shiba/images/random</code>:\r\n </p>\r\n <img\r\n style={{ width: \"320px\", borderRadius: \"var(--border-radius)\" }}\r\n alt=\"A random dog\"\r\n src={serverData.message}\r\n />\r\n <p>\r\n To learn more, head over to our{\" \"}\r\n <a href=\"https://www.gatsbyjs.com/docs/reference/rendering-options/server-side-rendering/\">\r\n documentation about Server Side Rendering\r\n </a>\r\n .\r\n </p>\r\n <Link to=\"/\">Go back to the homepage</Link>\r\n </Layout>\r\n )\r\n}\r\n\r\nexport default UsingSSR\r\n\r\nexport async function getServerData() {\r\n try {\r\n const res = await fetch(`https://dog.ceo/api/breed/shiba/images/random`)\r\n if (!res.ok) {\r\n throw new Error(`Response failed`)\r\n }\r\n return {\r\n props: await res.json(),\r\n }\r\n } catch (error) {\r\n return {\r\n status: 500,\r\n headers: {},\r\n props: {},\r\n }\r\n }\r\n}\r\n"],"names":["serverData","title","style","width","borderRadius","alt","src","message","href","Link","to"],"sourceRoot":""}