Skip to content

user registration, salt gen golang, rest api, mongodb, docker-compose

Notifications You must be signed in to change notification settings

giffone/task_for_go_dev_one

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2 microservises (golang, rest api, mongodb, docker-compose)

NEED TO DO task link

Run

in command line

make run

Stop

in command line

make stop

1.service - generate salt

request

http://localhost:8001/generate-salt

response

{
	"salt": "293960b3d957"
}

2.service - user

request create user

curl --request POST \
  --url http://localhost:8002/create-user \
  --header 'Content-Type: application/json' \
  --data '{
	"email": "aaa@mail.ru", 
	"password": "12345"
}'

response

{
	"status": "ok",
	"message": "user created"
}

request get user

http://localhost:8002/get-user/aaa@mail.ru

response

{
	"id": "63ee69b935dd1f2cb699ca0d",
	"email": "aaa@mail.ru",
	"password": "d8206c92cbf434c985c496fe3b6e684c",
	"salt": "825a1dc4321c"
}

or

{
	"status": "not found",
	"message": "mongo: no documents in result"
}

About

user registration, salt gen golang, rest api, mongodb, docker-compose

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published