Create config
touch configs/apiserver.toml
Config file can be empty, as it has default values, but you can add custom values something like:
bind_addr = ":8080"
log_level = "debug"
mongodb_url = "mongodb://localhost:27017"
mongodb_name = "testing"
Build server
make
Run tests
make test
- Download file provided in test task: users_go.json
- Delete some data in
users_go.json
file, so it will start with[
and end with]
- Import file data:
mongoimport --db testing --collection user --file users_go.json --type json --jsonArray --batchSize 1
- convert birth_date from string to date
db.user.find().forEach((el) => {
el.birth_date = new Date(el.birth_date);
db.user.save(el)
});
- Create index
db.user.createIndex( { "email": 1 }, { unique: true } )