Skip to content
No description or website provided.
Branch: master
Clone or download
Latest commit d86708e Oct 16, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
controllers tiny refactoring in wopi controller Feb 1, 2018
interfaces fix cs with go fmt tool Feb 1, 2018
models fix cs with go fmt tool Feb 1, 2018
services use sync.Map instead of map[] Oct 16, 2018
test fix cs with go fmt tool Feb 1, 2018
.codeclimate.yml update travis ci config, add codeclimate config Feb 1, 2018
.gitignore
.travis.yml update travis ci config, add codeclimate config Feb 1, 2018
Dockerfile update golang Oct 16, 2018
Gopkg.lock use sync.Map instead of map[] Oct 16, 2018
Gopkg.toml update dependencies, add Dockerfile, update readme Feb 1, 2018
README.md update readme Feb 6, 2018
config.example.yml update dependencies, add Dockerfile, update readme Feb 1, 2018
config.go fix cs with go fmt tool Jan 31, 2018
config_test.go fix cs with go fmt tool Jan 31, 2018
http_server.go tiny refactoring in wopi controller Feb 1, 2018
http_server_test.go fix cs with go fmt tool Feb 1, 2018
main.go use sync.Map instead of map[] Oct 16, 2018
main_test.go use sync.Map instead of map[] Oct 16, 2018
services.go fix cs with go fmt tool Jan 31, 2018
services_test.go fix http server, fix tests Jan 31, 2018

README.md

MS Office Online preview link generator

Build Status Maintainability Test Coverage

Setup

Create config from config.example.com

cp config.example.yml config.yml
vim config.yml

Setup dependencies

dep ensure

Run tests

go test ./...

Try some requests like this

Get preview link

POST http://0.0.0.0:8001/api/v1/previews

{"file_path": "/path/to/file/in/your/storage/example.xls"}

Status check

GET http://0.0.0.0:8001/api/v1/status/check

Run with docker

cd [project path]

sudo docker build -t msofficepreview .

// prod
sudo docker run --restart=always -d -p 8001:8001 --network host --mount type=bind,source=/storage/dir/path,target=/storage,readonly msofficepreview

// or dev
sudo docker run -d -p 8001:8001 --network host --mount type=bind,source=/home/storage,target=/storage,readonly msofficepreview 
// list containers
sudo docker ps

TODO

  • Add Redis support as a storage provider
  • Add Benchmark tests
  • Improve tests coverage
  • Improve speed
  • Add support of more WOPI methods
You can’t perform that action at this time.