This project demonstrates how to interact with the Interrupted.me's developer API for file uploads. It is built using Express.js, TypeScript, and EJS, providing a basic interface for uploading files and retrieving them.
- File upload with metadata (using multer for handling file uploads).
- Integration with dev.interrupted.me API for file uploads and retrieval.
- Rendering dynamic pages using EJS.
Before you can run this project, make sure you have the following:
- Node.js (v16.x or higher)
- TypeScript (installed globally)
git clone https://github.com/Z3R0zz/interrupted-dev-example.git
cd interrupted-dev-example
npm install
- Copy the
.env.example
file and rename it to.env.
- Update the variables with your own credentials:
INTD_BASE_URL="https://dev.interrupted.me"
INTD_API_KEY="YOUR_API_KEY"
INTD_USER_AGENT="YOUR_USER_AGENT"
To run the project in development mode:
npm run dev
This will start the server with hot-reloading enabled. The app will be available at http://localhost:5000.
To build the project:
npm run build
This will compile the TypeScript files and copy the views folder into the dist/ directory.
After building, you can start the application with:
npm start
This will run the compiled JavaScript files in the dist/ folder.
- Visit http://localhost:5000 to access the upload form.
- Select a file and submit the form. The file, along with its metadata, will be uploaded to the Interrupted.me API.
- If successful, you will be redirected to a page where you can view the uploaded file.
Uploaded files can be accessed via http://localhost:5000/u/:filename. Replace :filename with the actual filename returned from the API after a successful upload.
This project is licensed under the MIT License.