Skip to content

cloudx-labs/puntocommerceChallenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PuntocommersChallenge

Install

Do npm i


Create Database

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.


Run

Do npm start Server running at http://localhost:3000


Routes

  1. /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"
    }
]
  1. /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]"
        ]
    }
]
  1. /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
    }
]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published