Comments (3)
@Engineering-Robert I think there is an issue with your config. Did you check if all the required keys and all are there. Also, you need mongodb running using mongod
for it to work.
Sharing my config, this should work for you too.
const path = require("path");
const rootPath = path.normalize(__dirname + "/..");
module.exports = {
development: {
db: "mongodb://localhost/ntwitter",
root: rootPath,
app: {
name: "Node Twitter"
},
github: {
clientID: "e3930cf94c772ba10ef1",
clientSecret: "fb1284b1874444a9c0c55c963092f836596ecc56",
callbackURL: "http://localhost:3000/auth/github/callback"
}
},
test: {
db: "mongodb://root:[email protected]:39078/ntwitter",
root: rootPath,
app: {
name: "Nodejs Express Mongoose Demo"
},
github: {
clientID: "c2e0f478634366e1289d",
clientSecret: "0bfde82383deeb99b28d0f6a9eac001a0deb798a",
callbackURL: "http://nitter.herokuapp.com/auth/github/callback"
}
},
production: {
db: "mongodb://root:[email protected]:39078/ntwitter",
root: rootPath,
app: {
name: "Nodejs Express Mongoose Demo"
},
github: {
clientID: "c2e0f478634366e1289d",
clientSecret: "0bfde82383deeb99b28d0f6a9eac001a0deb798a",
callbackURL: "http://nitter.herokuapp.com/auth/github/callback"
}
}
};
from node-twitter.
I don't think it's a problem with the config. The issue appears to be with this bit of code in /node-twitter/app/controllers/tweets.js
exports.create = (req, res) => {
logAnalytics(req);
const tweet = new Tweet(req.body);
tweet.user = req.user;
tweet.uploadAndSave(req.files.image, err => {
if (err) {
res.render("tweets/new", {
title: "New Tweet",
tweet: tweet,
error: err.errors
});
} else {
res.redirect("/");
}
});
};
req.files.image
returns undefined
for me. I've passed in an empty object as the first argument to tweet.uploadAndSave
and that seems to have solved the issue for now. I'm not sure what req.files.image
is suppose to contain (is it a URL path to a profile image?).
from node-twitter.
Well I guess I'll close this issue since it seems like the fix I implemented isn't causing any other issues.
from node-twitter.
Related Issues (20)
- Dancing licenses? MIT -> BSD ->GPL3 ? HOT 6
- Pure 100% NodeJS application without MongoDB ? HOT 2
- Error: secret option required for sessions HOT 3
- [FEATURE] Setup with docker HOT 2
- port the project to use TypeScript HOT 8
- Unable to run application HOT 7
- Migrate LGTM.com installation from OAuth to GitHub App
- [BUG] Server Discovery and Monitoring engine is deprecated HOT 3
- [FEATURE] Move secrets to .env file HOT 10
- [BUG] Login Broken After Issue #252 merge HOT 6
- [FEATURE] Implement hashtags HOT 11
- [FEATURE] Add time to Activity list HOT 2
- [BUG]: Analytics doesn't show new users
- Fix CI HOT 2
- [FEATURE] Annoucement feature for admins
- [BUG] Tweet edit doesn't work HOT 7
- [FEATURE] Trending hashtags HOT 1
- [BUG] The latest master code crash in heroku and not on local
- [FEATURE] Migrate the database to mongodb Atlas free tier
- [BUG] Github Auth Button Returns a 404 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-twitter.