https://github.com/squat/drivefs
Use Google Drive as a static file server
https://github.com/squat/drivefs
golang google-drive http-server static
Last synced: about 1 year ago
JSON representation
Use Google Drive as a static file server
- Host: GitHub
- URL: https://github.com/squat/drivefs
- Owner: squat
- License: mit
- Created: 2018-04-03T18:14:43.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-17T00:00:18.000Z (about 8 years ago)
- Last Synced: 2025-02-08T16:44:33.228Z (over 1 year ago)
- Topics: golang, google-drive, http-server, static
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# drivefs
drivefs allows you to serve static files in your Go application from Google Drive using the familiar http.FileSystem interface.
[](https://goreportcard.com/report/github.com/squat/drivefs)
[](http://godoc.org/github.com/squat/drivefs)
## Usage
```go
import (
"log"
"net/http"
"google.golang.org/api/drive/v3"
"github.com/squat/drivefs"
)
func main() {
...
driveService, err := drive.New(oauthHttpClient)
// Handle error.
if err != nil {
log.Fatal(err)
}
fs := drivefs.New(driveService)
// Simple static webserver:
log.Fatal(http.ListenAndServe(":8080", http.FileServer(fs)))
}
```