-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.js
14 lines (11 loc) · 844 Bytes
/
routes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// the second set of pranthesis means the require statement returns a function AND that function will invoke immediatly after we require it to this file
const routes = require('next-routes')();
//we want CampaignShow (show.js) to render anytime a user goes to a specific capmaign directory
// the first argument to routes.add is the pattern we are going to look for, the variable comes after: can be passed to our component (CampaignShow)
// the second argument is the component in the route inside our pages directory we want this thing to show when someone goes to this address
routes
.add("/campaigns/new", "/campaigns/new")
.add("/campaigns/:address", "/campaigns/show")
.add("/campaigns/:address/requests", "/campaigns/requests/index")
.add("/campaigns/:address/requests/new", "/campaigns/requests/new")
module.exports = routes;