Build a front-end web

We are currently working on a project which includes Mobile Apps and a front-end website. The backend server has already been built and running as Java Application under Tomat, which support all the APIs.

I am wondering, if a front-end website could be built under same domain or across domain, and calling the same APIs from the backend server? like what Mobile App does?

Read More

By the way, all the front-end does not need to communicate with database, the data will be retrieved through server APIs.

I only done mobile apps, and a web greener, if there is anything misunderstanding, please comment, thanks:)

Update
Is it possible to use WordPress or Drupal to build this front-end website? or should I built myself with pure html?

Related posts

Leave a Reply

2 comments

  1. I am wondering, if a front-end website could be built under same domain or across domain, and calling the same APIs from the backend server? like what Mobile App does?

    Short answer: Yes.

    Slightly longer answer:

    • Provided that the front-end web pages don’t include or generate any URLs that refer to the backend site, there should be no cross-site issues. If possible, this is the architecture you should aim for.

    • If you do need the front-end web pages to include backend URLs1, then there are ways to deal with this … is the user’s web browser supports the relevant technologies; e.g. CORS.


    1 – … and the browser needs to be able to resolve / fetch them.

  2. If the backend is exposed as webservices, a front end webapp can call those services via ajax if they are in the same domain. If they are cross domain, it gets a little trickier because of the Same Origin Policy (there are techniques like JSONP and CORS to help with that).