- Ivan Minier
- Nodejs
- Express
- Typescript
- TSLint
-
Install dependencies
$ npm install
-
Run API
$ npm run start
-
/users
- Will return a list of users.
-
/events
- Will return all events for all users.
-
/events/user?id=[email protected]
- Will return all events for user email address provided.
-
/events/last24h
- Will return all events in the last 24 hours
Assumed this would be added to an existing project where endpoints were already secured.
Assumed data would already be available to the api thus there was no need to create end points to create and remove accounts. Used mock data and hard coded the time used to determine if a user logged in, in the last 24 hours, but would normally use system time and data from a database.
Assumed api users would require a way to see available users on the system before submitting a request for a user. Therefore I created the /users endpoint.
Given more time I would think of and cover some edge cases I might not have thought of. I would write tests and create more robust api docs.