A very basic "clone" of r/place written in Rust using warp.
Instead of rendering the image on the client side, the image is encoded as PNG and sent to the user. This doesn't scale well as that image is constructed every time someone sends a GET requests to /image. Ideally, you would render the image client-side and e.g. using WebSockets, send them notifications when a pixel was edited.
Features
There aren't that many:
When the server shuts down, the image data is stored in a file image and loaded back up when the server starts again.
API
GET/basic welcoming message
Responses
HTTP code
content-type
response
200
application/json
{"code":200,"message":"Welcome to r/place but in Rust!"}
Example
$ curl -X GET http://localhost:3030/
GET/imagesends the current canvas
Responses
HTTP code
content-type
response
200
image/png
Example
$ curl -X GET http://localhost:3030/image > image.png
Are you interested in building a secure authentication system for your Rust web application? Look no further than the Axum framework and JSON Web Tokens (JWTs)! Axum is a fast and scalable Rust web framework that provides a reliable and efficient platform for developing microservices and APIs.