-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 670bda6
Showing
42 changed files
with
1,607 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use_nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
functions/gateway | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 CueBlox Authors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
GOBIN=$(pwd)/functions go install ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"io/ioutil" | ||
"log" | ||
"net/http" | ||
"path/filepath" | ||
|
||
"github.com/apex/gateway" | ||
"github.com/cueblox/blox/content" | ||
) | ||
|
||
func main() { | ||
port := flag.Int("port", -1, "specify a port to use http rather than AWS Lambda") | ||
flag.Parse() | ||
listener := gateway.ListenAndServe | ||
portStr := "" | ||
|
||
userConfig, err := ioutil.ReadFile("blox.cue") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
repo, err := content.NewService(string(userConfig), true) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
hf, err := repo.GQLHandlerFunc() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
http.HandleFunc("/", hf) | ||
|
||
h, err := repo.GQLPlaygroundHandler() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
http.Handle("/ui", h) | ||
|
||
if *port != -1 { | ||
portStr = fmt.Sprintf(":%d", *port) | ||
listener = http.ListenAndServe | ||
staticDir, err := repo.Cfg.GetString("static_dir") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir(filepath.Join(".", staticDir))))) | ||
|
||
} | ||
|
||
log.Fatal(listener(portStr, nil)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
.DS_Store |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
data_dir: "data" | ||
schemata_dir: "schemata" | ||
template_dir: "data/tpl" | ||
static_dir: "static" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: Another Article | ||
category: introduction | ||
profile: bketelsen | ||
excerpt: Autem aliquam labore aspernatur accusantium harum facere. | ||
featured: true | ||
publish_date: "2021-03-19" | ||
last_edit_date: "2021-03-21" | ||
edit_description: Hello HN, thanks for stopping by! | ||
tags: | ||
- one | ||
- two | ||
image: jpg/main-img-preview | ||
--- | ||
|
||
Placeat consequuntur ullam aut sapiente illo velit. Eius facere ut molestias totam laborum pariatur quam. Praesentium quo veritatis expedita animi. | ||
|
||
Quite anything glass benefit. Such form clearly top tend can require my. Federal degree sort performance region maintain. | ||
|
||
Ut dignissimos sapiente culpa rerum pariatur consequatur. Corporis suscipit ad corrupti aut. Expedita culpa aut deleniti officiis. | ||
|
||
Porro eum id sit quia expedita. Alias expedita asperiores. Corporis ex eum atque cum ea. | ||
|
||
More to come soon! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: Hello World | ||
category: introduction | ||
profile: bketelsen | ||
excerpt: Autem aliquam labore aspernatur accusantium harum facere. | ||
featured: true | ||
publish_date: "2021-03-19" | ||
last_edit_date: "2021-03-21" | ||
edit_description: Hello HN, thanks for stopping by! | ||
tags: | ||
- one | ||
- two | ||
image: jpg/main-img-preview | ||
--- | ||
|
||
Placeat consequuntur ullam aut sapiente illo velit. Eius facere ut molestias totam laborum pariatur quam. Praesentium quo veritatis expedita animi. | ||
|
||
Quite anything glass benefit. Such form clearly top tend can require my. Federal degree sort performance region maintain. | ||
|
||
Ut dignissimos sapiente culpa rerum pariatur consequatur. Corporis suscipit ad corrupti aut. Expedita culpa aut deleniti officiis. | ||
|
||
Porro eum id sit quia expedita. Alias expedita asperiores. Corporis ex eum atque cum ea. | ||
|
||
More to come soon! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
name: Introduction | ||
description: Introduction to CueBlox | ||
--- | ||
|
||
Information about the Introduction Category Here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
file_name: images/jpg/main-img-preview.jpg | ||
height: 1188 | ||
width: 2272 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
file_name: images/png/bketelsens-report.png | ||
height: 700 | ||
width: 600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
title: About | ||
excerpt: Autem aliquam labore aspernatur accusantium harum facere. | ||
publish_date: "2021-03-19" | ||
tags: | ||
- one | ||
- two | ||
weight: 1 | ||
--- | ||
|
||
Placeat consequuntur ullam aut sapiente illo velit. Eius facere ut molestias totam laborum pariatur quam. Praesentium quo veritatis expedita animi. | ||
|
||
Quite anything glass benefit. Such form clearly top tend can require my. Federal degree sort performance region maintain. | ||
|
||
Ut dignissimos sapiente culpa rerum pariatur consequatur. Corporis suscipit ad corrupti aut. Expedita culpa aut deleniti officiis. | ||
|
||
Porro eum id sit quia expedita. Alias expedita asperiores. Corporis ex eum atque cum ea. | ||
|
||
Change |
Oops, something went wrong.