- Docker build
- Deploy to heroku with ENV VARIABLES (DB, URI)
- DB = Mongodb database name
- URI = Mongodb URI string in the format
user@password:url
data class User(
val email: String,
val name: String,
val password: String?,
)data class Post(
val _id: String,
val title: String,
val content: String,
val email: String,
val created: Long,
val updated: Long,
)data class PostRequest(
val content: String,
val title: String,
val email: String,
val password: String
)data class Response<out T>(
val status: Boolean,
val errorMessage: String,
val value: T,
)List all users
Response:
// List of users but without password field
val value: List<User>Check if the user with email exists
Response:
// true if user exists
val value: BooleanLogin with email and password
Request:
// only email & password (not name)
UserResponse:
// User object with password to store in local db
val value: UserRegister with email, name and password
Request:
UserResponse:
// email is returned back
val value: StringList all posts available, if email given list all posts published by that user
Query Params:
// user email optional
val email: StringResponse:
val value: List<Post>Returns the post by id
Response:
val value: PostUpdates the existing post
Request:
PostRequestResponse:
// post id
val value: StringPublish new post
Request:
PostRequestResponse:
// post id
val value: StringDelete the post
Request:
// current user
UserResponse:
val value: Boolean