next js routes and sitemaps..

Job ID: 35968905

Budget: $10 – $30 USD

I have a next.js app with expenses and locations APIs. There are 173.6k params in /api/locations, which include 1 Decembrie and 10 de Abril. And there are 144 params in /api/expenses, which include Home and Flight.

In the app, the /expenses dir will use getServerSideProps to create the /expenses/[expenseId] and /expenses/[expenseId]/[locationId] routes. The [expenseId] routes will use /api/expenses, while the [locationId] routes will use /api/locations. The robots.txt file will have sitemap/expenses/01 to 10 index sitemaps, each will have /sitemap/expenses/00001 to 50000 child sitemaps, and each will have a maximum of 50k routes. For example, each output should look like these:

app.com/expenses > Expenses
app.com/expenses/home > Home Expenses
app.com/expenses/home/1-decembrie > Home Expenses in 1 Decembrie

In the app, the /flight dir will use getServerSideProps to create the /flight/[locationId] routes from /api/locations. Each param in the API will be paired with each others and separated by 'to' and 'from'. The robots.txt file will have sitemap/flight/to/01 to 10 index sitemaps, each will have /sitemap/flight/to/00001 to 50000 child sitemaps, each will have a maximum of 50k routes, and the same thing will be done for ... /flight/from. For example, each output pair should look like these:

app.com/flight
app.com/flight/locationName1-to-locationName2
app.com/flight/locationName1-from-locationName2
app.com/flight/locationName2-from-locationName1
app.com/flight/locationName2-to-locationName1
Related categories: JavaScript Node.js MongoDB MERN Stack Next.js