Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Javascript 

Linking webpages to Node.js

Can anybody help me figure out how to link an html script to a Node.js database? I suspect its through export but I'm not sure.
Can you explain what you mean and want to achieve?
(May 14, 2019 01:33 PM)Lynx Wrote:  Can you explain what you mean and want to achieve?

I want to take something like form data or any type of user input and store it inside node.js file. I'm confused when it comes to npms and json and modules which I haven't worked with. I've never worked on the back-end of things before. So I guess the best way to describe what Im trying to is simply make the back-end of a website and servers.
(May 14, 2019 04:40 PM)Ex Nihilo Wrote:  I want to take something like form data or any type of user input and store it inside node.js file. I'm confused when it comes to npms and json and modules which I haven't worked with. I've never worked on the back-end of things before. So I guess the best way to describe what Im trying to is simply make the back-end of a website and servers.

Store the HTML directly in the database in a column. Retrieve that HTML if needed, depending on what you're trying to do.
[Image: CJLOhGd.gif]

(May 14, 2019 04:40 PM)Ex Nihilo Wrote:  I want to take something like form data or any type of user input and store it inside node.js file. I'm confused when it comes to npms and json and modules which I haven't worked with. I've never worked on the back-end of things before. So I guess the best way to describe what Im trying to is simply make the back-end of a website and servers.

Yes, if you want to store form data you have to create a web server first. Best way (in my opinion) is using express. Very nice npm package and easy to use. When you have set this up, you need to do something with the data. If you are using a database, you do whatever is needed and what the docs say. If you want to store the data in a json file, use the pre-installed package fs. Do a quick google on “store json with node fs” and you will be good to go.
(May 14, 2019 11:09 PM)Lynx Wrote:  Yes, if you want to store form data you have to create a web server first. Best way (in my opinion) is using express. Very nice npm package and easy to use. When you have set this up, you need to do something with the data. If you are using a database, you do whatever is needed and what the docs say. If you want to store the data in a json file, use the pre-installed package fs. Do a quick google on “store json with node fs” and you will be good to go.

Ok thank you. Lookin it up now.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Javascript]  by de_g3ntl3m4nDec 15, 2020 03:43 AM 0 106 Dec 15, 2020 03:43 AM
Last Post: de_g3ntl3m4n
[PHP] by JoshBeaverMar 12, 2015 05:31 AM 7 126 Mar 12, 2015 05:31 AM
Last Post: JoshBeaver
[PHP] by lmorraMay 25, 2014 11:23 PM 10 216 May 25, 2014 11:23 PM
Last Post: lmorra