简体   繁体   中英

Pushing Node.js files to AWS

I have a node.js file that runs locally when I run it and it sends the user a text notification via the Twilio service. However, I'm trying to deploy it to my AWS Ubuntu server (EC2) so I can use it now on my actual website, but I'm not sure how to upload a local file to my instance like I did when I was following this tutorial ( https://hackernoon.com/tutorial-creating-and-managing-a-node-js-server-on-aws-part-1-d67367ac5171 ) when I initially mkdir server and then cd into it which ultimately contained index.js, node_modules, and server file.

Now on my local folder, it also contains a folder called node_modules that currently has an express folder and a Twilio helper folder. So would I have to put the Twilio folder within the node_modules folder in AWS and is there a way to do this through the Terminal?

Additionally, I was curious if my app.js (Node) file would even function if my Twilio file is hosted on a GoDaddy server? I hope I made sense and any help is appreciated.

You can use the rsync command line utility (available on Linux, Mac, but also on Windows with Cygwin).

The way you'd use it is:

rsync -e 'ssh -i YOUR_AWS_KEY.pem' -avh /path/to/your/local/folder YOUR_AWS_USER@YOUR_AWS_HOSTNAME:/your/remote/path

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM