/image-server

express static image server

Primary LanguageTypeScript

Express Static File Server

This project is an example of how to serve static files using an Express application.

Getting Started

Follow these instructions to set up and run the project on your local machine.

Prerequisites

  • Node.js installed on your machine
  • npm (Node Package Manager) or yarn

Installation

  1. Clone the repository:

    git clone https://github.com/wminaung/image-server.git
    cd image-server

1. Define API Endpoint

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

2. Response Type


export interface ImageUploadResponseType {
  url: string; // full url
  path: string;
  size: number;
  filename: string;
  host: string | undefined;
  protocol: string;
}