Skip to content

A simple ⬆️ upload service built using Node.js, Express.js, and JavaScript using my template microservice-template-nodejs-js.

License

Notifications You must be signed in to change notification settings

YourAKShaw/upload-service

Repository files navigation

⬆️ Upload Service

repo-banner

A simple ⬆️ upload service built using Node.js, Express.js, and JavaScript using my template microservice-template-nodejs-js.

Usage && Notes

Sample

  • 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

Upload

Two types of upload supported:

  1. File Attachment
  2. File URL

File Attachment

POST /api/upload

form-data
Key Value
fieldName (File) [attachment]

File URL

POST /api/upload

raw
{
  "fileUrl": "<fileUrl>"
}

Get to know me 😉

⚪ Author: Ayush Kumar Shaw

⚪ Website: yourakshaw.com

⚪ X: @YourAKShaw

License

This template is MIT licensed.

About

A simple ⬆️ upload service built using Node.js, Express.js, and JavaScript using my template microservice-template-nodejs-js.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published