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
var bodyParser = require("body-parser"), | |
express = require("express"), | |
app = express(), | |
Cosmic = require("cosmicjs"); | |
var api = Cosmic(); | |
var bucket = api.bucket({ | |
slug: "favorite-book", | |
read_key: "QxlWYVywWwJu94x9vVp3DJFt11OqLIUJRBBp0i4FyqbpvtOOhp" | |
}); |
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
{ | |
"name": "cosmicjs_bookapp", | |
"version": "1.0.0", | |
"description": "Book App for Cosmic JS", | |
"main": "app.js", | |
"scripts": { | |
"start": "node app.js" | |
}, | |
"author": "Luke Netti", | |
"license": "ISC", |
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
<% include ./partials/header.ejs %> | |
<div class="ui text container main center aligned"> | |
<h1 class="title center aligned">List of Favorite Books</h1> | |
<div class="ui stackable two column grid"> | |
<% for(var i = 0; i<books.total; i++) { %> | |
<div class="column"> | |
<div class="ui segment"> | |
<a href="/books/<%= books.objects[i].slug %>"><h4 id="title"><%= books.objects[i].title %></h4></a> | |
<a href="/books/<%= books.objects[i].slug %>"> |
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
<% include ./partials/header.ejs %> | |
<div class="ui text container main center aligned"> | |
<h2 class="title"><a href="/" ><i class="fas fa-arrow-circle-left fa-sm"></i></a><%= book.object.title %></h2> | |
<div class="ui stackable two column grid"> | |
<div class="column"> | |
<div class="ui segment center aligned"> | |
<img class="ui medium bordered centered image" src="<%= book.object.metadata.image.imgix_url %>"> | |
</div> |
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
<html> | |
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700,700i" rel="stylesheet"> | |
<body> | |
<audio id="greenSound"> | |
<source src="https://s3.amazonaws.com/freecodecamp/simonSound1.mp3"></source> | |
</audio> | |
<audio id="redSound"> | |
<source src="https://s3.amazonaws.com/freecodecamp/simonSound2.mp3"></source> | |
</audio> | |
<audio id="yellowSound"> |