From 0e0a1c6f350c9b97b35276a798f67aa7ac7a7159 Mon Sep 17 00:00:00 2001 From: pitu Date: Sat, 14 Jan 2017 18:42:38 -0300 Subject: [PATCH] Updated readme --- README.md | 16 +++++++++++----- controllers/uploadController.js | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 183b188..2b4b25d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Pomf-like image uploading service, written in NodeJS --- 1. Clone 2. Rename `config.sample.js` to `config.js` -4. Modify port and token options if desired +4. Modify port, basedomain and token options if desired 3. run `npm install` to install all dependencies 5. run `pm2 start lolisafe.js` or `node lolisafe.js` to start the service @@ -16,11 +16,17 @@ But if you want to run it privately, you need to specify a random string, which --- ## Using it -After the service is started, you can POST files to /api/upload . The file key needs to be called `file` and it should be a `multipart/form-data` upload, or else it will be disregarded. +Once the service starts, you can start hitting the upload endpoint at `/api/upload`. +When sending a file to it, be sure the form name is set to `file`, and if the app you're using asks, the type of form is `multipart/form-data`. Once the request has been made, if everything goes smoothly you should be receiving a json with the key `url`. Sample: -This works great with sharex, just like [cuntflaps.me](https://cuntflaps.me) and [mixtape.moe](https://mixtape.moe). -A chrome extension to be able to right click images -> send to safe is in the works. +```json +{ + "url": "https://i.kanacchi.moe/pqkI.png" +} +``` + +This service works great with apps like ShareX, since it's a lot like [cuntflaps.me](https://cuntflaps.me) or [mixtape.moe](https://mixtape.moe). +A chrome extension to be able to `right click` images -> `send to safe` is in the works. If you are using nginx, you should set inside your location block the following directive, replacing the number with the one you want set up `client_max_body_size 512M;` - If using apache, you should change the following directives on your config `RLimitMEM 512M` diff --git a/controllers/uploadController.js b/controllers/uploadController.js index 7754261..1e0ccad 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.js @@ -39,7 +39,7 @@ uploadsController.upload = function(req, res, next){ galleryid: gallery }).then(() => { return res.json({ - 'url': config.uploads.basedomain + req.file.filename + 'url': config.basedomain + req.file.filename }) })