<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: mukul</title>
    <description>The latest articles on DEV Community by mukul (@mukulrathi8).</description>
    <link>https://dev.to/mukulrathi8</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F708059%2Fd9a4d5d9-81d0-4845-9723-7f9615bc4f81.png</url>
      <title>DEV Community: mukul</title>
      <link>https://dev.to/mukulrathi8</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mukulrathi8"/>
    <language>en</language>
    <item>
      <title>ExpressJs without nodemon</title>
      <dc:creator>mukul</dc:creator>
      <pubDate>Mon, 11 Nov 2024 10:00:53 +0000</pubDate>
      <link>https://dev.to/mukulrathi8/expressjs-without-nodemon-374d</link>
      <guid>https://dev.to/mukulrathi8/expressjs-without-nodemon-374d</guid>
      <description>&lt;p&gt;&lt;strong&gt;In this article, we’ll show you how to use the --watch flag, What is the --watch Flag?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;--watch&lt;/strong&gt; flag is a feature in Node.js that allows your server to automatically restart whenever you change your code. It works just like nodemon, but without needing to install any third-party packages.&lt;/p&gt;

&lt;p&gt;How to Use the --watch Flag&lt;br&gt;
Update package.json &lt;br&gt;
&lt;code&gt;{&lt;br&gt;
  "name": "express",&lt;br&gt;
  "version": "1.0.0",&lt;br&gt;
  "main": "index.js",&lt;br&gt;
  "scripts": {&lt;br&gt;
    "serve": "node index",&lt;br&gt;
    "dev": "node --watch index"&lt;br&gt;
  },&lt;br&gt;
  "author": "",&lt;br&gt;
  "license": "ISC",&lt;br&gt;
  "description": "",&lt;br&gt;
  "dependencies": {&lt;br&gt;
    "express": "^4.21.1"&lt;br&gt;
  }&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now run the script&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm run dev&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Your server will restart whenever you make changes to your code like nodemon does.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Next JS Server Side Api</title>
      <dc:creator>mukul</dc:creator>
      <pubDate>Mon, 29 Apr 2024 09:40:35 +0000</pubDate>
      <link>https://dev.to/mukulrathi8/next-js-server-side-api-1pkd</link>
      <guid>https://dev.to/mukulrathi8/next-js-server-side-api-1pkd</guid>
      <description>&lt;p&gt;Next.js stands out as a robust framework that facilitates both client and server-side rendering, setting it apart from other React frameworks. With client-side rendering, all code is generated in the client's browser. However, with server-side rendering, pages can be pre-rendered on the server before being sent to the client.&lt;/p&gt;

&lt;p&gt;To achieve server-side rendering with Next.js, follow these steps:&lt;br&gt;
So how to achieve this &lt;/p&gt;

&lt;p&gt;Step 1: Create an 'actions' folder in your Next.js directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flmugu4qkacmjcjmodege.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flmugu4qkacmjcjmodege.PNG" alt="Image description" width="372" height="543"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2. Populate the actions folder with async functionse.e.g (fetch, Axios)&lt;br&gt;
`export async function Test() {&lt;/p&gt;

&lt;p&gt;}&lt;br&gt;
`&lt;br&gt;
Step 3. *&lt;em&gt;Utilize these async functions in your Next.js pages *&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Since Next.js primarily renders pages on the server-side, you'll need to call these functions within your pages to fetch data. Here's an example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;export default async function Dummy() {&lt;br&gt;
    const Data = await Test();&lt;/code&gt;&lt;br&gt;
    console.log(Data);&lt;/p&gt;

&lt;p&gt;Following these steps allows you to implement server-side rendering with Next.js, enabling efficient data fetching from APIs. &lt;br&gt;
Feel free to reach out if you have any questions or need further clarification!&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>serversideapi</category>
      <category>getsserversideprop</category>
      <category>await</category>
    </item>
  </channel>
</rss>
