No description
Find a file
2017-07-10 17:57:50 +02:00
.gitignore implemented configuration from config.json file 2017-06-21 00:33:14 +02:00
config.json config print struct on run 2017-07-10 17:57:50 +02:00
goImgServer config print struct on run 2017-07-10 17:57:50 +02:00
handlers.go minimal config changes 2017-06-21 20:08:46 +02:00
imageModel.go REST architecture implemented 2017-06-20 09:01:46 +02:00
imageOperations.go implemented configuration from config.json file 2017-06-21 00:33:14 +02:00
ipFilter.go implemented configuration from config.json file 2017-06-21 00:33:14 +02:00
LICENSE Initial commit 2017-06-20 09:01:10 +02:00
logger.go REST architecture implemented 2017-06-20 09:01:46 +02:00
main.go config print struct on run 2017-07-10 17:57:50 +02:00
readConfig.go update 2017-06-21 16:10:45 +02:00
README.md renamed 2017-06-21 08:58:47 +02:00
router.go REST architecture implemented 2017-06-20 09:01:46 +02:00
routes.go REST architecture implemented 2017-06-20 09:01:46 +02:00

goImgServer

Server of images, written in Go lang

This is a server to post images and serve images. File type accepted:

- PNG
- JPG
- JPEG

All the files are converted to PNG, and resized to the configured sizes.

Use

upload example (with curl):

curl -F file=@./image1.png http://127.0.0.1:3050/image

to get image:

http://127.0.0.1:3050/images/image1.png

Configuration

Example configuration file (config.json):

{
    "folder": "files",
    "blockedIPs": [
        "192.168.1.3",
        "147.116.48.158"
    ],
    "allowedIPs": [
        "127.0.0.1"
    ],
    "imgWidth": 200,
    "imgHeigh": 0
}

The "allowedIPs" are the IPs allowed to post images.

"blockedIPs" are the IPs blocked from posting images.

Also, all IPs not present in the "allowedIPs", will be blocked.