diff --git a/.gitignore b/.gitignore index cf709889..600e365e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -**/node_modules +**/node_modules \ No newline at end of file diff --git a/.idea/express-personal-api.iml b/.idea/express-personal-api.iml new file mode 100644 index 00000000..c3cd732c --- /dev/null +++ b/.idea/express-personal-api.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..319f9a80 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..3f28dff8 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..c90baaf6 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,582 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + todo + this + delete-bu + data-movie + closest + find( + "get" + -icon + + + + + + + + + + + true + + false + true + true + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + `); + movieData.forEach(function(lists) { + listing += ` +
+
+ +
Title: ${lists.title}
+
Release: ${lists.year}
+
Director: ${lists.director}
+ + +
+ + +
+ +
+
Title:
+
Release:
+
Director:
+ + +
+
+
` + }) + $('.all-listing').append(listing); + }; diff --git a/public/styles/styles.css b/public/styles/styles.css index 57b4da0e..5f6fee9a 100644 --- a/public/styles/styles.css +++ b/public/styles/styles.css @@ -1,10 +1,81 @@ + + body { color: #333; font-family: Helvetica, Arial, sans-serif; - background-color: skyblue; /* Sanity Check! */ } h1 { margin-top: 100px; text-align: center; } + +.nav-styles { + padding: 10px 0; + opacity: 0.5; +} + +.nav-list-styles { + font-size: 35px; + margin: 0 50px; +} + +img { + height: 100px; + width: 100px; +} + +.movie-image { + height: 350px; + width: 100%; + margin: 50px 25px 15px 25px; +} + +.list-text { + font-family: Arial, Helvetica, sans-serif;; + text-align: left; + font-size: 25px; + margin: 0 0 0 25px; +} + +.edit-movies { + width: 30%; + margin: 0 0 0 25px; +} + +.save-movies { + width: 30%; + margin: 0 0 0 25px; +} + +.delete-movies { + width: 30%; + margin: 0 0 0 25px; +} + +.list-display { + display: inline; +} + +.list-edit { + display: none; +} + +.list-input { + width: 50%; + margin: 5px 0; +} + +body { + background-image: url('/images/background.jpg'); + background-size: cover; + background-repeat: no-repeat; +} + +.all-listing { + margin: 0 0 25px 0; +} + +div h1 { + margin-top: 0; +} \ No newline at end of file diff --git a/seed.js b/seed.js index 896dead0..8c08384a 100644 --- a/seed.js +++ b/seed.js @@ -1,15 +1,36 @@ // This file allows us to seed our application with data // simply run: `node seed.js` from the root of this project folder. +//app will talk to server which will talk to seed.js +var db = require('./models'); +var personalData = []; -// var db = require('./models'); +personalData.push({name: 'David Jue'}); +personalData.push({githubUsername: 'Congocash'}); +personalData.push({githubLink: 'https://github.com/CongoCash'}); +personalData.push({githubProfileImage: '../public/images/github-image.png'}); +personalData.push({personalSiteLink: 'https://peaceful-chamber-97994.herokuapp.com/'}); +personalData.push({currentCity: 'San Francisco'}); +personalData.push({ + hobbies: [ + { + name: 'Basketball', + yearsPlaying: 13, + }, + { + name: 'Tetris', + yearsPlaying: 5 + }, + ] +}) -// var new_campsite = {description: "Sharp rocks. Middle of nowhere."} -// db.Campsite.create(new_campsite, function(err, campsite){ -// if (err){ -// return console.log("Error:", err); -// } -// console.log("Created new campsite", campsite._id) -// process.exit(); // we're all done! Exit the program. -// }) + +db.Personal.create(personalData, function(err, data){ + if (err){ + return console.log("Error:", err); + } + + console.log("Created new campsite", data) + process.exit(); // we're all done! Exit the program. +}) diff --git a/server.js b/server.js index fd366289..fd9046c1 100644 --- a/server.js +++ b/server.js @@ -1,6 +1,6 @@ // require express and other modules -var express = require('express'), - app = express(); +var express = require('express'); +var app = express(); // parse incoming urlencoded form data // and populate the req.body object @@ -15,6 +15,8 @@ app.use(function(req, res, next) { next(); }); +var controllers = require('./controllers'); + /************ * DATABASE * ************/ @@ -59,6 +61,30 @@ app.get('/api', function apiIndex(req, res) { }) }); +app.get('/api/profile', function apiProfile(req, res) { + res.json({ + name: 'David Jue', + githubUsername: 'Congocash', + githubLink: 'https://github.com/CongoCash', + githubProfileImage: '../public/images/github-image.png', + personalSiteLink: 'https://peaceful-chamber-97994.herokuapp.com/', + currentCity: 'San Francisco', + hobbies: [{ + name: 'Basketball', + yearsPlaying: 14 + }, + { + name: 'Tetris', + yearsPlaying: 6 + }] + }); +}); + +app.post('/api/movies', controllers.movies.create); +app.get('/api/movies', controllers.movies.index); +app.get('/api/movies/:movieid', controllers.movies.show); +app.delete('/api/movies/:movieid', controllers.movies.destroy); +app.put('/api/movies/:movieid', controllers.movies.update); /********** * SERVER * **********/ diff --git a/views/index.html b/views/index.html index 48e39ae6..40a923e1 100644 --- a/views/index.html +++ b/views/index.html @@ -19,11 +19,36 @@
-
-

Under Construction

-

Read My API Documentation

+
+

Click on an icon below

+ +
+ + + + + + + + + +
+
+