Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix site view counter #34

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Fix site view counter #34

wants to merge 10 commits into from

Conversation

saura8668
Copy link

Fix the site view counter issue by creating backend logic using NodeJS and MongoDB Atlas

@vercel
Copy link

vercel bot commented Oct 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aa-memory ❌ Failed (Inspect) Oct 8, 2023 3:14pm

@idna001 idna001 linked an issue Oct 8, 2023 that may be closed by this pull request
3 tasks
Copy link
Owner

@idna001 idna001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, not tested yet. In this status I can't merge it, cause of deployment issues.
Still its hacktoberfest-accepted
There may are some complications, in use of Vercel. Since it's the free Version.

But I see in the Error of the deployment.
There are many warnings and the note on the bottom, that openssl is not allowed.
I think that's needs to be required for the database.
Thanks for your contribution.
May there is another more simply way.

grafik

src/App.js Outdated Show resolved Hide resolved
@@ -0,0 +1,16 @@
require('dotenv').config(); // Load environment variables from .env file
const mongoose = require('mongoose');
const mongoURI = `mongodb+srv://saura8668:${process.env.USER_KEY}@cluster0.c48azqk.mongodb.net/viewcount`;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here is missing the .env File

Isnt it possible to run mongo db on this same server?
If not, I rather configure this.

useNewUrlParser: true,
useUnifiedTopology: true,
});
console.log(`MongoDB Connected ${conn.connection.host}-${conn.connection.port}`);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more a dev only thing, don't want to show in prod


const PORT = 3030
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dev only please

@sonarcloud
Copy link

sonarcloud bot commented Oct 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix the View Counter
2 participants