This project is an example of how to serve static files using an Express application.
Follow these instructions to set up and run the project on your local machine.
- Node.js installed on your machine
- npm (Node Package Manager) or yarn
-
Clone the repository:
git clone https://github.com/wminaung/image-server.git cd image-server
Define an API endpoint for uploading images. The endpoint URL should be in the format apiurl -> /images/foodman
with the HTTP method POST
. Ensure that the field name for the image in the request payload is foodman
.
Example:
API URL: http://${hostname}/images/foodman
Method: POST
Field Name: foodman
export interface ImageUploadResponseType {
url: string; // full url
path: string;
size: number;
filename: string;
host: string | undefined;
protocol: string;
}