Reputation: 29
I have a microservice that has a usermanagement service. In the service I created a .env file and stored my secret. It however does not a give a token when I bring up the services using docker-compose up.
(I have required doenv in my index.js, I have installed jwt, The .env is inside the service folder not the docker-compose folder)
kindly advice.
Upvotes: 0
Views: 137
Reputation: 731
json()
only takes one argument, but you're currently passing in two.
Change res.status(201).json(admin, token)
to res.status(201).json({ admin, token })
Upvotes: 1