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.
|
Javascript
Linking webpages to Node.js |
(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. ![]() (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. |
|
|



![[Image: CJLOhGd.gif]](https://i.imgur.com/CJLOhGd.gif)