nax3t / webdevbootcamp Goto Github PK
View Code? Open in Web Editor NEWAll source code for back-end projects from the Web Developer Bootcamp
All source code for back-end projects from the Web Developer Bootcamp
im trying to use "request-promise now and im having a very hard time.
var express = require("express");
var app = express();
var rp = require("request-promise");
app.set("view engine", "ejs");
app.get("/", function(req, res){
res.render("search");
});
app.get("/results", function(req, res){
var query = req.query.search;
var options = {
method: "GET",
uri: "http://omdbapi.com/?s=" + query,
};
rp(options)
.then((body)=> {
var data = JSON.parse(body)
console.log(data);
// Process html..
})
.catch((err)=> {
console.log( "error",err)
// Crawling failed...
});
app.listen(process.env.PORT, process.env.IP, function(){
console.log("Movie App has started!!!");
});
Possibly create a .gitignore that does not include .c9 and node-modules folders? It really is a pain download the content to a local system on a slower network!
The sections don't have READMEs properly formatted with the Markdown spec.
Web development from nax3t
isLoggedIn middleware needs to be removed from https://github.com/nax3t/webdevbootcamp/blob/master/YelpCamp/v10/routes/index.js
Since it has been moved into the /middleware index.js
Hello!
I'm trying to resolve a problem with "Cannot read property 'substring' of undefined". Unfortunately, I have tried several options, but none of them gives the expected result. I have both deleted the database collection and tried to replace it with the if condition ( index file),
<% if(blog.body && blog.body.length > 0) { %>
<p><%= blog.body.substring(0, 100)%></p>
<% } > %
but it does not work and by deleting a post, it actually adds one:
What are the possible solutions in this case?
https://goor.me/Ax6az
P.S. added a file of my code at bottom of the page
Thanks in advance,
maox27
YelpCamp routes/index.js line 22 change needed from:
req.flash("error", err.message);
return res.render("register");
to:
return res.render("register", {"error": err.message});
or:
req.flash("error", err.message);
return res.redirect("register");
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.