I want to build a Web app using the Star Wars API using JSON. The app it self will be just a search that gives the results of what the json has inside. I've started looking at team tree house php course and realse 99% of the things done in PHP: var, objects, arrays, etc... can be done through pure JavaScript. .. so my question why would I need to use PHP, Ruby Python or any other backend language?
Asked
Active
Viewed 129 times
0
-
Also can I get mysql queries and add with just Javascript – Jayswager Jan 06 '15 at 00:03
-
What's wrong with using a server-side Javascript, like NodeJS or its many alternatives? – Lee Daniel Crocker Jan 06 '15 at 00:06
-
1I suppose client-side javascript queries to MySQL are possible, but not necessarily a good idea. See, for example, [How to connect to SQL server database from javascript?](http://stackoverflow.com/questions/857670/how-to-connect-to-sql-server-database-from-javascript). – lurker Jan 06 '15 at 00:07
-
Going to assume that should be http://swapi.co/ – Scuzzy Jan 06 '15 at 00:10
-
This is actually a good question. I've edited it to fit the StackOverflow guidelines. The main reason to use an backend here, rather than have the browsers to talk directly to the Star Wars API, would be to load the code onto the browser in the first place, and also to protect the API key you're using (so only people using your app can use your StarWars API key) – mikemaccana Dec 29 '15 at 14:49
1 Answers
0
You can use any API in client side using browsers' XMLHttpRequest so in your case you do not need to use any backend language. There is no must to use backend language in showing data to users. You can check defiantjs library
If your app will have any user interaction (comment on a character, adding new characters etc), you must use a backend language and proper database solution.

onesvat
- 156
- 2
- 10