mirror of
https://github.com/gmemstr/sliproad.git
synced 2024-09-19 16:11:11 +01:00
641e015ca6
Removed common package, since it was largely useless and instead integrated what I could into the router package. Should simplify things going forward, but we can always split this out later. Also completely removed authentication for the time being - want to consider other options for this.
30 lines
550 B
Go
30 lines
550 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/gmemstr/nas/files"
|
|
"github.com/gmemstr/nas/router"
|
|
"github.com/go-yaml/yaml"
|
|
"io/ioutil"
|
|
"log"
|
|
"net/http"
|
|
)
|
|
|
|
// Main function that defines routes
|
|
func main() {
|
|
// Initialize file providers.
|
|
file, err := ioutil.ReadFile("providers.yml")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
err = yaml.Unmarshal(file, &files.ProviderConfig)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
files.SetupProviders()
|
|
|
|
r := router.Init()
|
|
fmt.Println("Your NAS instance is live on port :3000")
|
|
log.Fatal(http.ListenAndServe(":3000", r))
|
|
}
|