- What about event-related stuff for the auth service?
- It turns out that no other services really need to know about what the auth service is doing!
- Everything the auth service does is exposed through that JWT in the cookie
Option #3 is selected
- public organisation is selected
- Goto https://www.npmjs.com/
- create chticketing public organisation
npm init -y
git init
git add .
git commit -m "initial commit"
npm login
npm publish --access public
- There might be differences in our TS settings between the common lib and our services - don't want to deal with that
- Services might not be written with TS at all!
- Our common library will be written as Typescript and published as Javascript
cd section-12/ticketing/common
tsc --init
git status
git add .
git commit -m "additional config"
npm version patch
npm run build
npm login
npm publish --access public
- move errors and middlewares from auth services to common npm module
- install necessary libraries
npm i express express-validator cookie-session jsonwebtoken @types/cookie-session @types/express @types/jsonwebtoken
npm run pub
npm i @chticketing/common
import { errorHandler, NotFoundError } from '@chticketing/common';
cd section-12/ticketing/common
npm run pub
cd ../auth
npm update @chticketing/common
kubectl get pods
kubectl exec -it auth-depl-86c85d4895-n4bp4 sh
/app # cd node_modules/@chticketing/common
/app # cat package.json