This is a TypeScript Express server that integrates with ImageKit for handling image-related functionalities.
-
Clone the repository:
git clone https://github.com/scriptscrypt/imagekit-server-ts.git cd imagekit-server-ts -
Install dependencies:
yarn install
-
Create a
.envfile in the root of your project based on the.env.examplefile.cp .env.example .env
Update the values in the
.envfile with your ImageKit credentials. -
Run the development server:
yarn dev
The server will start at http://localhost:3000.
Make sure to set the following environment variables in your .env file:
IK_PUBLIC_KEY: Your ImageKit public key.IK_PRIVATE_KEY: Your ImageKit private key.IK_URL_ENDPOINT: Your ImageKit URL endpoint.
Example:
IK_PUBLIC_KEY=your-public-key
IK_PRIVATE_KEY=your-private-key
IK_URL_ENDPOINT=your-url-endpoint- Route:
/api/imagekit-auth - Method:
GET - Description: Get authentication parameters from ImageKit.
- Example Response:
{ "signature": "...", "expire": "..." // Other authentication parameters }
Feel free to contribute to the project by opening issues or submitting pull requests. Contributions are welcomed!
This project is licensed under the MIT License.