{"id":793,"date":"2024-12-19T14:07:31","date_gmt":"2024-12-19T13:07:31","guid":{"rendered":"https:\/\/portfolio.articole-smart.eu\/?post_type=rara-portfolio&#038;p=793"},"modified":"2024-12-19T14:07:31","modified_gmt":"2024-12-19T13:07:31","slug":"next-js-hebergement-sur-vercel-home-linux-pc","status":"publish","type":"rara-portfolio","link":"https:\/\/portfolio.articole-smart.eu\/index.php\/portfolio\/next-js-hebergement-sur-vercel-home-linux-pc\/","title":{"rendered":"Next JS, Hebergement sur Vercel, Home Linux PC"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Simple application CRUD pour g\u00e9rer les taches d&rsquo;une \u00e9quipe IT.<\/p>\n\n\n\nngg_shortcode_0_placeholder\n\n\n\n<p class=\"wp-block-paragraph\"> <\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"export async function getServerSideProps() {\n  const resData = await fetch(`${process.env.API_URL}\/resources`);\n  const data = await resData.json();\n\n  console.log(\n    data.map((resource) =&gt; {\n      return {\n        params: { id: resource.id },\n      };\n    })\n  );\n\n  return {\n    props: {\n      resources: data,\n    },\n  };\n}\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D4D4D4\">export async <\/span><span style=\"color: #569CD6\">function<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">getServerSideProps<\/span><span style=\"color: #D4D4D4\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> resData = await <\/span><span style=\"color: #DCDCAA\">fetch<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">`${process.env.API_URL}\/resources`<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> data = await resData<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">json<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  console<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">log<\/span><span style=\"color: #D4D4D4\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    data<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">map<\/span><span style=\"color: #D4D4D4\">((resource) =&gt; {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">      <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        params: { id: resource<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">id },<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">      };<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    })<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  );<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    props: {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">      resources: data,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    },<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  };<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Simple application CRUD pour g\u00e9rer les taches d&rsquo;une \u00e9quipe IT.<\/p>\n","protected":false},"author":1,"featured_media":799,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ngg_post_thumbnail":0},"rara_portfolio_categories":[31,19,18,55,17],"class_list":["post-793","rara-portfolio","type-rara-portfolio","status-publish","has-post-thumbnail","hentry","rara_portfolio_categories-api","rara_portfolio_categories-backend","rara_portfolio_categories-frontend","rara_portfolio_categories-nextjs","rara_portfolio_categories-react"],"_links":{"self":[{"href":"https:\/\/portfolio.articole-smart.eu\/index.php\/wp-json\/wp\/v2\/rara-portfolio\/793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/portfolio.articole-smart.eu\/index.php\/wp-json\/wp\/v2\/rara-portfolio"}],"about":[{"href":"https:\/\/portfolio.articole-smart.eu\/index.php\/wp-json\/wp\/v2\/types\/rara-portfolio"}],"author":[{"embeddable":true,"href":"https:\/\/portfolio.articole-smart.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/portfolio.articole-smart.eu\/index.php\/wp-json\/wp\/v2\/comments?post=793"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/portfolio.articole-smart.eu\/index.php\/wp-json\/wp\/v2\/media\/799"}],"wp:attachment":[{"href":"https:\/\/portfolio.articole-smart.eu\/index.php\/wp-json\/wp\/v2\/media?parent=793"}],"wp:term":[{"taxonomy":"rara_portfolio_categories","embeddable":true,"href":"https:\/\/portfolio.articole-smart.eu\/index.php\/wp-json\/wp\/v2\/rara_portfolio_categories?post=793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}