Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
We are thinking about implementing our new module with a Javascript framework GUI and Java backend.
The plan is that we call Ajax calls from the GUI to get the data from the backend.
Our worry is (due to our inexperience) is that if we deploy the GUI to http://server1 and the Java backend to http://server2, then wont the relevant Ajax calls from server1 to server2 qualify as Cross site scripting?
How can we prevent this in javascript frameworks?
(We are looking at Angular, Knockout, Ember.js, etc)
Have a look at CORS (Cross-origin resource sharing) http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
You basically need to specify, in the header of the response from the web service, which referers are allowed.
For example:
Access-Control-Allow-Origin: http://server1
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 months ago.
Improve this question
Is it possible to temporarily cache all requests in the Rails backend?
Sometimes it's helpful to make frontend stuff without waiting for the backend on the page to reload.
Your question is very ambiguous. If you don't want to wait on the backend for development then you can cache your requests on the front-end using local storage or other client-specific APIs.
On the other hand, if you need backend caching it won't really serve your purpose because the client will still need to make the API call.
Lastly, if you need to mock your APIs then there are multiple such tools available. One that I like is https://designer.mocky.io/
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am wondering how to make simple and secure rest communication between my backend and frontend. I need to send some POST request's to my backend and somehow i need to secure that. This is simple app without any users accounts.
Serve your app over HTTPS instead of HTTP. Any calls made from angularjs using $http will be secured, you don't have to do anything here.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
So question is do we need backend framework e.g. Laverel etc. if we user Angular\React? Don't undestend why we need cuz i use baclend only for REST API, I can not understand why they can be useful if we do all job on froendend
The need for server side code is largely independent from the use of client side code.
Many projects require server side and client side code in order to function at all (e.g. if data needs to be shared between users of a site). Even those that don't usually should involve server side code as a best practise.
Given a project where server side code is needed, there is never a need for a framework. A framework is a tool that can (in some circumstances) make the development of code easier, but can always be replaced with from scratch code. A developer should select the most appropriate tool for the job.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have developed a basic web app using normal client-side code (not using angularjs) and the Laravel framework for the backend. A friend (in the software business) is joining to help me refine it and he questioned me using a PHP framework and instead says he would re-write it using AngularJS.
Is AngularJS capable of full read/write of a database to create a dynamic website? Since AngularJS is a javascript framework, I only understood that to mostly be used for front-end and a project would still need a back-end language like PHP.
Thanks,
Angular is a front-end (i.e. browser) framework - it can't run on the server without lots of backflips and hacks, and wouldn't buy you a whole lot anyway.
You could write the back end using node.js to connect to your databases and possibly get Angular running partially on the server to generate your initial pages. This is a technique known as "isomorphic javascript" (among other terms). It's an optimization, but if what you've got works I'd stick with it.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I'm using angularjs for my application, which is so secure (similar like banking application),i have another option of using freemarker or velocity ..
whether it is best to go with angularjs or we can use freemarker or velocity. if so could you please explain. the backend service is spring boot .
Freemarker is just a templating engine, it's not a full front-end framework with 2 way data binding like angularjs is. Also, with angular it's very easy to build Single Page Applications which have a very smooth user experience compared to traditional applications where you must reload the page every time the user navigates to another page. If you already know angular, it's the better choice. If you don't know angular, then freemarker is much faster to learn but not quite as powerful/good. Though I do quite like freemarker as a templating engine.