This repo shows you the steps to go through to update a project from JavaScript to TypeScript.
It was based on the advice from Dominik Kundel's blog post on moving to TypeScript at your own pace.
First clone or download the repo and change into the directory.
git clone https://github.com/philnash/four-steps-from-javascript-to-typescript.git
cd four-steps-from-javascript-to-typescript
Install the dependencies:
npm install
Run the application.
npm start
You can now visit http://localhost:3000
and see a static HTML page or make a POST
request to http://localhost:3000/webhooks/messages
and get a dad joke in TwiML format for responding to incoming SMS messages to a Twilio number.
curl --data "" http://localhost:3000/webhooks/messages
<?xml version="1.0" encoding="UTF-8"?><Response><Message>It was raining cats and dogs the other day. I almost stepped in a poodle.</Message></Response>
You can follow the directions in the blog post to move this repo to TypeScript. There are also branches that show the changes at each stage.