Skip to content

Commit

Permalink
First Post
Browse files Browse the repository at this point in the history
  • Loading branch information
bketelsen committed Jul 24, 2021
0 parents commit 670bda6
Show file tree
Hide file tree
Showing 42 changed files with 1,607 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use_nix
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
functions/gateway
.vscode
21 changes: 21 additions & 0 deletions LICENSE
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.
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GOBIN=$(pwd)/functions go install ./...
55 changes: 55 additions & 0 deletions cmd/gateway/main.go
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))
}
2 changes: 2 additions & 0 deletions functions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.DS_Store
Empty file added functions/.keep
Empty file.
6 changes: 6 additions & 0 deletions functions/blox.cue
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"
}
24 changes: 24 additions & 0 deletions functions/data/articles/another.md
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!
24 changes: 24 additions & 0 deletions functions/data/articles/hello-world.md
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!
6 changes: 6 additions & 0 deletions functions/data/categories/introduction.md
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
3 changes: 3 additions & 0 deletions functions/data/images/jpg/main-img-preview.yaml
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
3 changes: 3 additions & 0 deletions functions/data/images/png/bketelsens-report.yaml
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
19 changes: 19 additions & 0 deletions functions/data/pages/about.md
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
Loading

0 comments on commit 670bda6

Please sign in to comment.