Purpose: practice and refine my TypeScript skills, fix any gaps.
Based on Udemy course: Udemy: Typescript: The Complete Developer's Guide
Use Parcel to compile strip .ts (TypeScript) code ~~~into~~ of annotations and bundle into .js (JavaScript), which can be included in an HTML file.
Install parcel and parcel-bundler:
$ npm install -g parcel parce-bundlerRun using:
$ parcel index.html
Server running at [host]Note: index.html file contains an API key, which is obviously generally bad practice and should for example exist in a private config or env variable. In this case, it is already publicly available via a popular online course, so highly unlikely to cause problems. We don't have to nuke the entire repo.
- ✅ When API key no longer relevant, replace with
<API_KEY>. While it will still be in source control history, it will be less obvious.