Routing Segments in Next Js

  • Add Segments in Routing, Folder Structure just like:
  • Code for src/app/contact/[...person]/page.js file:


    "use client"
    import React from 'react'

    const page = (props) => {
        console.log("params", props)
        return (
            <div>
                person segments
            </div>
        )
    }

    export default page

  • We make this type of url segments:
http://localhost:3000/contact/gagan/aggarwal
http://localhost:3000/contact/rohit/kumar
http://localhost:3000/contact/priya/singh
http://localhost:3000/contact/abc/dfe/rt/d/dsdf/gff/x/de

No comments:

Post a Comment

Date and Time related aggregation functions ($year, $month, $dayOfMonth, $hour, $minute, $second, $dayOfWeek, $dateToString, $dateSubtract, $dateAdd, $isoWeek, $isoDayOfWeek, $dateTrunc, $dateFromString, $dateToParts, $dateFromParts, $dateDiff, $week)

In this blog post, we will explore Date/Time-related Aggregation Functions in MongoDB. MongoDB provides a robust set of aggregation operator...