A simple ⬆️ upload service built using Node.js, Express.js, and JavaScript using my template microservice-template-nodejs-js.
-
Contains Sample module from microservice-template-nodejs-js.
-
Since the Sample module makes use of the MongoClient from mongodb, it requires the MONGODB_URI in the .env, otherwise the server won't start. One way to bypass this, in case you don't need to checkout the Sample module and use only the Upload module, is to commenting the following piece of code from sample.model.js.
const sampleCollection = await (async () => { const db = await getDb(); return db.collection('samples'); })(); // Immediately Invoked Function Expression (IIFE) for collection creation
Two types of upload supported:
- File Attachment
- File URL
POST /api/upload
Key | Value |
---|---|
fieldName (File) | [attachment] |
POST /api/upload
{
"fileUrl": "<fileUrl>"
}
⚪ Author: Ayush Kumar Shaw
⚪ Website: yourakshaw.com
⚪ X: @YourAKShaw
This template is MIT licensed.