Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7680443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:06:56+00:00 2026-05-31T18:06:56+00:00

I am trying to build a system that uses nodejs with express to render

  • 0

I am trying to build a system that uses nodejs with express to render html pages based on data from another backend service. The backend service provides JSON data that the nodejs server uses to render the html and then pass to the browser. Having read up on REST and the Hyemedia constraint I want to use this in the design, but can not seem to figure it out. A simple example would be a page that provides a list of items in which each item is a link that can be clicked on to get the full details of that item. So the backend service might make some JSON that looks like

{
  "title": "List of items"
  "self": "http://api.hostname.com/items
  [
    { 
      "title":"item1",
      "url": "http://api.hostname.com/items/1
    }
    { 
      "title":"item2",
      "url": "http://api.hostname.com/items/2
    }        { 
      "title":"item3",
      "url": "http://api.hostname.com/items/3
    }
}

I then have nodejs render a page in html with a list of links using “title” for the name. The issue is then I don’t know what to use for the href. It would work if the href is to a view that with render the item like

href="/items/2

but I have no way of pass the “url” field back to node so node can pass that to the backend service. I end up building the url for the backend service based on the view url. Which if I understand REST is not the Hypermedia way. It means my node code has to know the format of the urls of the backend service instead of getting the urls and using directly.

So is there so clever feature like adding the “url” field as a query parameter of the href to preserve it on the client? I am misunderstanding the Hypermedia Constraint or should I being trying to use it at all?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T18:06:57+00:00Added an answer on May 31, 2026 at 6:06 pm

    Whether you should use the hypermedia constraint is a matter of opinion. (I have a blog post stating my own opinion).

    As a more specific answer, I’ll point out that you actually have 2 separate REST systems in this application, one of which is serving html and one of which is serving json. If they are equivalent in functionality, the hypermedia constraint would expect that they actually be a single system, where requests could return different media types based on the Accepts http header. This eliminates your problem (because the urls become the same).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build System.Data.SQLite in Visual Studio using the source code downloaded from
I'm trying to build a Windows installer using Nullsoft Install System that requires installation
I'm trying to build a app that uses the SmsMessage class but there are
I'm trying to build an c# application that uses the WebBrowser Control for, obviouly,
I'm trying to build some code on Ubuntu 10.04 LTS that uses OpenSSL 1.0.0.
I am trying to build a core application that uses plugins so that the
I was trying to compile some C++ source that uses scons as its build
I'm trying to set up a custom backend that queries another database, for which
I am currently trying to build a small system that read's in a bunch
I'm trying to build a navigation system using categories table with hierarchies. Normally, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.