You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
813 B

7 years ago
  1. # goImgServer
  2. Server of images, written in Go lang
  3. This is a server to post images and serve images.
  4. File type accepted:
  5. ```
  6. - PNG
  7. - JPG
  8. - JPEG
  9. ```
  10. All the files are converted to PNG, and resized to the configured sizes.
  11. ## Use
  12. upload example (with curl):
  13. ```
  14. curl -F file=@./image1.png http://127.0.0.1:3050/image
  15. ```
  16. to get image:
  17. ```
  18. http://127.0.0.1:3050/images/image1.png
  19. ```
  20. ## Configuration
  21. Example configuration file (config.json):
  22. ```
  23. {
  24. "folder": "files",
  25. "blockedIPs": [
  26. "192.168.1.3",
  27. "147.116.48.158"
  28. ],
  29. "allowedIPs": [
  30. "127.0.0.1"
  31. ],
  32. "imgWidth": 200,
  33. "imgHeigh": 0
  34. }
  35. ```
  36. The "allowedIPs" are the IPs allowed to post images.
  37. "blockedIPs" are the IPs blocked from posting images.
  38. Also, all IPs not present in the "allowedIPs", will be blocked.