Code Monkey home page Code Monkey logo

Comments (6)

andrewmarklloyd avatar andrewmarklloyd commented on August 9, 2024 1

@ashishkharcheiu the only way to populate data is through adding to the database. The posts actually come from the Wordpress API via the sedaily-miner. If you're looking only to use the API with pre-seeded data then you should be able to accomplish it this way:

git clone [email protected]:SoftwareEngineeringDaily/sedaily-front-end.git
cd sedaily-front-end/devops
docker-compose up

Then open your browser to http://localhost:4040/api/posts.

from software-engineering-daily-api.

ashishkharcheiu avatar ashishkharcheiu commented on August 9, 2024 1

Ahh. the posts came from sedaily-miner! I was wondering what's the source.

So to use api-repo as standalone, I might have to create my own POST endpoints and code to generate post id and all content.

Thank you for response.

from software-engineering-daily-api.

andrewmarklloyd avatar andrewmarklloyd commented on August 9, 2024

@ashishkharcheiu you can use Docker to run the API and the database which has data already seeded. Check out the README for how to run it.

from software-engineering-daily-api.

ashishkharcheiu avatar ashishkharcheiu commented on August 9, 2024

@andrewmarklloyd Backend is running with MongoDB using docker. I have looked at SWAGGER API docs as well.

When we run the app, the "posts" collection is empty. The ISSUE I am asking to assist with is "how do we fill the collection "posts" with data, as I could not see any POST request for it.

In the below link, https://software-enginnering-daily-api.herokuapp.com/api/posts you see the data is available for the link, BUT how can I input the data in same way in "posts" collection so that when I do request: "https://localhost:4040/api/posts, I get the "posts" data and NOT the empty array.

Hope it clears what I am asking.

The only way I see is adding data directly to MongoDB database with an POST API endpoint for it.

from software-engineering-daily-api.

andrewmarklloyd avatar andrewmarklloyd commented on August 9, 2024

@ashishkharcheiu my apologies, I was confusing two of the repos. I was thinking about the front-end repo which references the pre-seeded Docker image. If you take a look at the front-end repo readme it talks about using that image. You can basically use this docker-compose file instead
https://github.com/SoftwareEngineeringDaily/sedaily-front-end/blob/master/devops/docker-compose.yml

from software-engineering-daily-api.

ashishkharcheiu avatar ashishkharcheiu commented on August 9, 2024

@andrewmarklloyd I read the README in front-end repo and also ran the vue App.

But it was not related to the issue it seems. I am going to write what I expected with backend and what I received to convey my issue better.

  • https://github.com/SoftwareEngineeringDaily/software-engineering-daily-api -> Clone the repo and run as per README in the api-repo.

  • Use POSTMAN and create "posts" through a POST request. --------> Here, I assumed I would find an endpoint for creating NEW posts, but I did not find looking through SWAGGER docs and code itself. (Note: I was able to create a USER through a POST request to clarify.)

  • NOW I am confused at this point, so there is NO endpoint for creating "posts" through POSTMAN, then how the data or episodes or posts are added to the database by the developers??

To be clear, How to populate / create / add New DATA to this "posts" collection through POSTMAN?

issue_posts_sedaily_mongodb

from software-engineering-daily-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.