Do npm i
First, create the MySql server and configure the credentials in ./config.js
. Then download the dump in ./dump/puntocommerschallenge_dump.sql
and import it in MySql Database for create the Database, the User table and the mock data from the user table.
Do npm start
Server running at http://localhost:3000
/api/user
Get users list.
Ex:
[
{
"id":2,
"name":"Carlos",
"email":"[email protected]",
"username":"cviera",
"status":"NUEVO"
},
{
"id":3,
"name":"Joe",
"email":"[email protected]",
"username":"jdoe",
"status":"NUEVO"
},
{
"id":4,
"name":"Homer",
"email":"[email protected]",
"username":"hsimpsons",
"status":"NUEVO"
}
]
/api/user/email/duplicated
Get potencially duplicated emails
Ex:
[
{
"email":"[email protected]",
"duplicated":[
"[email protected]",
"[email protected]"
]
},
{
"email":"[email protected]",
"duplicated":[
"[email protected]",
"[email protected]"
]
},
{
"email":"[email protected]",
"duplicated":[
"[email protected]",
"[email protected]"
]
}
]
/api/user/email/char_count
Count occurrences of a char in all emails
Ex:
[
{
"char":"o",
"count":12
},
{
"char":"m",
"count":9
},
{
"char":"n",
"count":4
},
{
"char":"e",
"count":4
},
{
"char":"i",
"count":4
},
{
"char":"j",
"count":3
},
{
"char":"d",
"count":3
},
{
"char":"b",
"count":3
},
{
"char":"c",
"count":3
},
{
"char":"s",
"count":3
},
{
"char":"h",
"count":2
},
{
"char":"r",
"count":1
},
{
"char":"p",
"count":1
},
{
"char":"x",
"count":1
}
]