Example Architect app making use of @architect/plugin-typescript
npm i
npm run start
Try changing files in the TypeScript handler at src/http/get-index/
, and even deploying to AWS (npx arc deploy
)!
This is an absurdly simple app intended to demonstrate:
While your entire project can be TypeScript, it doesn't have to be.
In this application get /
is TypeScript, while get /js
is a plain JS handler.
Watch Architect TypeScript's built-in sourcemap support work by throwing within a handler (see: src/http/get-index/message/copy.ts
L2).
Architect's built-in shared code folders (src/shared
+ src/views
) work as expected with the plain JS handler.
The TypeScript handler uses its own unique shared backend code folder (src/shared-ts
, totally arbitrary), while still making use of shared code in src/views
and src/shared
(by way of tsconfig.json
> compilerOptions
> paths
setting).
Note: you do not have to follow these shared code conventions for your project. Whatever works for you is fine! This app just demonstrates one approach that happens to interface with Architect's built-in shared code functionality.