This short tutorial will show you how you can use the Twitter API to post a tweet on twitter via your Angular and Node Application.
You can start your node program with creating a project directory
mkdir server cd server npm init touch server.js
and install the twit api and express js into your node project
npm install twit body-parser cors express
create your twitter app on the twitter developers page https://apps.twitter.com/
then copy and paste this code into your server.js file which you need to create in your node application, which you can do simply by creating a file called server.js
You can get these details from the twitter developers website when you created your app.
In your Server.js File.
then in your angular project just copy and paste this code into a service, and call it where ever you would like.
Keep in mind that this will only work in a local environment, if you want to use it in a live environment, then just host your node app via Heroku and your Angular App however you would like, I would recommend firebase as its super quick and simple and free. then just change the urls appropriately.