This is a basic repo that will write a cookie and read a cookie using AdonisJs.
npm install
- Duplicate the
.env.example
file and save as.env
. - Generate an APP_KEY and save it in your new
.env
. npm run dev
- Browse to http://127.0.0.1:3333/bake-cookie to create a cookie.
- Browse to http://127.0.0.1:3333/eat-cookie to read the cookie. The value should be "Chocolate Chip".
- The terminal will read the cookie on every request via the
ReadCookieMiddleware.ts
and output the cookie value to the terminal.
- Check out the
routes.ts
for the creating/reading of the cookie.