Comments (2)
Hi @AmanSingh137, thanks for opening up the issue. The backend APIs are "down" because I'm using Heroku for the backend which shut down its free-tier plan (which the project was using) and I don't intend to switch to a premium plan. Basically, no backend service to connect to. I haven't found a decent free alternative to Heroku and I also don't have the time to migrate at the moment. Furthermore, I don't have any JSON files for the data. You can try using something like DummyJSON.
Regarding mongoose.Types.ObjectId
, that's basically a type (in this case, the type is an ID). In the model, it's mentioned what the reference is. For example, this is models/post.js
:
likes: [{ type: mongoose.Types.ObjectId, ref: 'User' }],
bookmarks: [{ type: mongoose.Types.ObjectId, ref: 'User' }],
unicorns: [{ type: mongoose.Types.ObjectId, ref: 'User' }],
//1 post => 1 author, hence an object
//mongoose.Types.ObjectId tells mongoose it's a real mongoose id
//'ref' establishes connection between postSchema and userSchema
//The ref option is what tells Mongoose which model to use during population (It will populate post with the author)
comments: [{ type: mongoose.Types.ObjectId, required: true, ref: 'Comment' }],
author: { type: mongoose.Types.ObjectId, required: true, ref: 'User' },
Let me know if you need any further help :)
from dev.to-clone.
Hi, thanks for your help. By the way, the problem wasn't about having dummy data, but the problem was to run the APIs locally. I did that and the user experience of uploading posts and using them with multiple users and playing with notifications is fun. for others, I would say to please use app.use(cors()); if you are getting cors error and remove google, github, twitter and other modes of authentication in order to proceed further. You can implement those by reading the current documentations by yourself, but for beginning purpose, please comment out those features to learn how the code really works. Closing the issue now.
from dev.to-clone.
Related Issues (4)
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 dev.to-clone.