To start a secure web service with Auth0 in Typescript, you can follow these steps:
index.ts69 chars4 lines
index.ts137 chars3 lines
server.ts and add the following code:index.ts1360 chars58 linesReplace YOUR_DOMAIN and http://localhost:3000 in the authConfig object with your own values.
Start the server by running tsc to compile TypeScript to JavaScript, and then node dist/server.js to start the server.
index.ts24 chars3 lines
http://localhost:3000/api/private endpoint from your browser or API client, passing a valid JWT token in the Authorization header.gistlibby LogSnag