4d01e13a84
* Revert "Revert structured logging 2 (#1240)"
This reverts commit 78ecaeffcb.
* Logging should not be bundled into core shared directory
* making sure observability stuff isnt bundled into frontend
Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
20 lines
628 B
JavaScript
20 lines
628 B
JavaScript
require('../bootstrap')
|
|
const { logger } = require('@/logging/logging')
|
|
const { createUser } = require('@/modules/core/services/users')
|
|
const axios = require('axios').default
|
|
|
|
const main = async () => {
|
|
const userInputs = (
|
|
await axios.get('https://randomuser.me/api/?results=250')
|
|
).data.results.map((user) => {
|
|
return {
|
|
name: `${user.name.first} ${user.name.last}`,
|
|
email: user.email,
|
|
password: `${user.login.password}${user.login.password}`
|
|
}
|
|
})
|
|
await Promise.all(userInputs.map((userInput) => createUser(userInput)))
|
|
}
|
|
|
|
main().then(logger.info('created')).catch(logger.error('failed'))
|