0

I know this is Novice question but couldnt find a best way to do it.

I want to build a rest API with paramater inbetween like

/api/blogs/:blogid/articles/:articleId

I want to route to proper method and identify both blogid and articleid and return response.

Thanks and Best Regards Moyeen

procoder
  • 31
  • 1
  • 7

1 Answers1

0
.post('/api/blogs/:blogid/articles/:articleId',
        function(req,res){
       Console.log(req.params.blogid)
       Console.log(req.params.articleId)
       }

In this Api .. Request parameters will give the desired results

Sorry for indentation using mobile app And do up vote if helpful ... :)

  • Which redirection ?? Show me ur code .... To get the response back just do res.status(200).json{}; – Aashish Mangal Dec 09 '14 at 19:26
  • in router.js of the yoeman generated structure i have app.use('/api/articles', require('./api/articles')); and in index.js of blogs controller. router.get('/:id/articles/:articlesid',controller.articlefetch); – procoder Dec 09 '14 at 19:37