How can I implement frontend in API without using a framework? - spring

hope you are having a great day.
I will get straight to the point, I have an application in Spring. I am using API calls from postman to retrieve my data.
Now I am asked to implement a front-end but without a framework, I was told that only ajax and javascript should do the trick.
How would I be able to implement this?
Keep in mind it is not an MVC application, but rather an API.
Thanks in advance

Several ways of doing so ! You can use
Javascript
Jquery
Angular JS
Check if below article helps
How to call a REST web service API from JavaScript?

Related

Use Angular with Laravel

Anyone know if the best aproach to use laravel and angular is to use angular as Front-End and laravel as back end , or can i use both of them in all in One ?
In the case of each option can you explain please why is that the best aproach ?
Thanks Guys !
The best approach is to create a RESTFUL api in laravel as the backend, and use angular as the font-end client. This is currently the most popular approach as angular is great for creating what are known as "Single Page Applications" (SPA's). SPA's are popular because they allow you to create a seamless user experience by appropriately handling asynchronous behaviour. By keeping your REST api separate from your UI, you can also then add other clients as needed, such as a mobile/native client.

Making AJAX call from chrome extension to Meteor web app

Hi I have made a web app to practice Meteor and am now trying to make a companion chrome extension. I am having difficulty finding resources on how to make AJAX calls to my meteor app/mongodb.
An example of what I am trying to do is find specific words on a webpage and search them in my mongodb.
Any resources or information on how to best do this would be appreciated.
I suppose you know how to make Ajax call from client. So you are having difficulty in building a REST API in Meteor. Although it is not recommended to build a REST API with Meteor, you can still do it. If you use case just require a REST API and does not have much to do with reactivity, I think you should not go with Meteor, just Node and Express should be fine.
But if you really want to use Meteor, here is the solution: Meteor has a package named webapp which let you handle HTTP requests, that is enough for building a simple REST API. If you API is more complex, check out this community package nimble:restivus it has a better API and useful functions

Mongolab API with ajax

I'm trying to build an app with comment system and wanna know if
is there any safe way to use the mongolab api without share my key with everyone?
if not what you guys recommend to use instead of mongolab api key with ajax.
Thanks.
Unfortunately there is no way to use the mLab Data API with Ajax and keep the API Key safe. We recommend implementing your own RESTful API server on top of your mLab database that can act as a gatekeeper to the database. Your client application would then make Ajax requests to the API server.
Although this tutorial uses Angular instead of Ajax, here is a good example of the architecture I've described: https://devcenter.heroku.com/articles/mean-apps-restful-api.

AJAX enabled WCF service in MVC?

So I can create a simple AJAX enabled WCF Service and consume it in Javascript in a basic WebForm as found in this example on MSDN (http://msdn.microsoft.com/en-us/library/bb924552.aspx).
Is it possible though to do this in ASP.NET MVC 3/4? The problem is there is no ScriptManager control obviously, which allows me to reference the service to be used in the javascript.
If it's not possible - how do I consume a WCF service inside javascript from ASP.NET MVC?
I cannot find any examples of this online either.. My google fu is off and I can't figure out what I'm missing here.
thanks!
Make sure that your WCF service works with JSON and then use JQuery to call the service. This might help: http://pranayamr.blogspot.com/2010/12/steps-to-call-wcf-service-using-jquery.html

Designing a web service to be used by the iPhone and a web client

I'm designing a web service that serves up JSON through a REST API. This API is currently being used by an iPhone app to do CRUD operations.
My question is, can I design a web client that uses this REST API using nothing more than ExtJS (or some other RIA framework) and HTML pages? In other words, can I create a static HTML page that uses ExtJS to send AJAX calls to the REST API and receive JSON data from it? Or is this thinking too naive and wrong?
I think this is perfectly acceptable as long as you know that your users browser will be able to handle javascript and AJAX accordingly.
Yes! YES! You can use static html and js files, served by any web server, to build an Ext JS application. Ext JS is very happy to talk REST and JSON to your web service.
Build your Ext JS application outside of ASP.NET MVC. You don't need it.

Resources