StreetCommunityProgrammer / metaphore

Story as Code. Public Collections of Metaphore our Freestyler accross the world. Gain knowledge with unusual perspective from our Punk members.
https://metaphore.vercel.app
GNU General Public License v3.0
26 stars 5 forks source link

Easy fetching on Next.js | SCP Metaphor #17

Closed utterances-bot closed 1 year ago

utterances-bot commented 1 year ago

Easy fetching on Next.js | SCP Metaphor

Metaphore Name Easy fetching on Next.js Share your metaphore story! Sometimes, we face fetching issue between development and production NODE_ENV.. Next.js need a canonical URL once you use SSR strategy, but it’s not required on local development. A quick utility could be: Create a config/index.tsx at the root of the project Add: const dev = process.env.NODE_ENV !== "production"; export const server = dev ? "http://localhost:3000" : "https://your_deployment.server.com"; And use this metaphore this way on SSR strategy pages: // src/pages/index.tsx import type { NextPage } from "next"; import Head from "next/head"; import React, { forwardRef, useEffect, useRef

https://streetcommunityprogrammer.github.io/metaphore/metaphore/stories/javascript/easy-fetching-on-nextjs/

darkterminal commented 1 year ago

Congratulations 🎉 !!! Your metaphor is first content on this community

github-actions[bot] commented 1 year ago

Hello Punk! It's great having you contribute to this project

Welcome to the community :neckbeard:

If you would like to continue contributing to open source and would like to do it with an awesome inclusive community, you should join our GitHub Organisation - we help and encourage each other to contribute to open source little and often :neckbeard:. Any questions let us know.