Making my own website with server [closed] - javascript

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 am making my own website and I've never really done it before. I am familiar with each of the separate parts, but I've never put them all together before.
I want to have html and javascript on the front end. This would send HTTP requests to my PHP on the backend. The PHP would then have an open socket with my java server that would store data in mysql or mongodb.
javascript client, PHP backend, Java server, mysql/mongo database.
Is this the appropriate way to set up a restful api in a general sense? If not, how should I do it?

You have it right. Javascript on the front end and PHP on the backend is an incredibly popular and powerful combination. The Apache server seems to be more popular among PHP users, but a java server works just fine.

Related

sending data from client and receiving it on the server such that any client can access it in vanilla js [closed]

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 months ago.
Improve this question
I was wondering if there was any way to set up a website such that you could send data from the client to a server (no libraries at all, even for the server) and store it there (in local storage: https://www.w3schools.com/HTML/html5_webstorage.asp) entirely in vanilla js.
This article is about sending. I don't know why do you talk about the local storage.
Storing it involves the server. You could learn Node.js (JS) or Flask (python) to do this.
If the server otherwise is not configured properly, it wouldn't allow to store the sent data permanently!

trying to implement a search on mongoDB and get the results to display on page [closed]

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 2 years ago.
Improve this question
search functiondisplays the searchimplements the search
React is completely back-end agnostic. This means you would have to implement the connection yourself.
The regular way is, you setup MongoDB and a Node.js server (or whatever back-end you like) then you connect the Node.js server to MongoDB (via MongoDBs JavaScript SDK) and your React client, which runs in the browser to your Node.js server (via HTTP, express framework could help here).
Browser -> Node.js -> MongoDB.
But MongoDB also has a REST interface you could use directly via the browser, like it's mentioned in the following answer:
https://stackoverflow.com/a/16277603/1016383
Would probably be okay for small proof of concepts or experiements,.

When should you use PHP(cURL) over JavaScript (Axios, Ajax, Fetch) [closed]

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 2 years ago.
Improve this question
If I need to interact with a web API for making HTTP requests like POST and GET, would a javascript program be a better option or a PHP one?
It's totally based on your choice. Javascript is a client side language and PHP is a server side language. If you look for your page not to load for an API call, front end frameworks like Angular can help performing crud operations with a good user experience. In case you wish to use PHP, you can simply use JavaScript (Ajax), which again is a good choice for user experience to call a server side script (PHP), and then perform crud operations from there.

How should I structure .net website to use a web api? [closed]

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 6 years ago.
Improve this question
I'm starting a project that will use a search bar to hit a web api and return the results. There will be no writing to the web api.
My biggest struggle when creating a new project is how it should be laid out. I never know when i should create a DAO, do it all via javascript, put it in a controller, etc.
For developing something like a search engine or any web application. You would need following:
A frontend, which is your application's GUI in browser of user or mobile application.
A backend logic, this could be in any server side scripting language, in your case you would be writing server code in .net
Now, your backend must expose a search api, Eg. If I send a HTTP GET with a variable q, it should return search results matching the query.
Your frontend must have input-box and a button for allowing users to send this request.
This answer isn't complete, just a vague overview of how this problem can be approached, also this isn't the only solution.

Send data online from one device to another using AJAX [closed]

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 8 years ago.
Improve this question
I'm trying to make a web application which uses a mobile phone as a controller (an example of this kind of thing: http://chrome.com/supersyncsports/). It isn't something very complicated, I just need to send text which was entered in the phone to the computer. I don't need any database, I just need to send text from one device to another. Is there a way to do this with AJAX and without PHP?
Thanks,
bhc11
This is possible but it's not simple. You will need to setup a browser-to-browser peer-to-peer connection.
See WebRTC and Wikipedia for a high overview of the technology.
You are going to need some server back-end to process this. You will make your ajax call to the server which reads and determines the location to send the text on to. Since you are using mobile, you will need to either send a push notification to the second user, or you need to have the users polling for new content.

Categories