kunaal438 / blogging-site Goto Github PK
View Code? Open in Web Editor NEWThis project is a mini version of a working blogging website. This project is done by using only HTML, CSS and JS. This is a node.js app. And using firebase as its databse.
This project is a mini version of a working blogging website. This project is done by using only HTML, CSS and JS. This is a node.js app. And using firebase as its databse.
the image couldnt be uploaded i tried to work on it but i cant do it.
// For Firebase JS SDK v7.20.0 and later, measurementId is optional const firebaseConfig = { apiKey: "AIzaSyA_YSMfzvPHK_1UAeZjlcyUnoMmBntr3XQ", authDomain: "blog-77507.firebaseapp.com", projectId: "blog-77507", storageBucket: "blog-77507.appspot.com", messagingSenderId: "547768921904", appId: "1:547768921904:web:83fcb30dfa1f39235d62f5", measurementId: "G-8R4QGVG1CG" };
Hi Kunaal,
Need help brother. How can I reach you?
Regards
The upload image function is having trouble fetching, some type of problem with the async that I've been trying to debug but can't figure out where the issue is at, please fix the fetch error.
editor.js:26
Uncaught (in promise) TypeError: Failed to fetch
I figure this is a long shot, but I'm trying to incorporate your blog template into an Angular webapp. I'm having an issue where the .post and .collection methods aren't appearing in Firestore. Ref:
publishBtn.addEventListener('click', () => {
if(articleField.value.length && postTitleField.value.length){
// generating id
let letters = 'abcdefghijklmnopqrstuvwxyz';
let postTitle = postTitleField.value.split(" ").join("-");
let id = '';
for(let i = 0; i < 4; i++){
id += letters[Math.floor(Math.random() * letters.length)];
}
// setting up docName
let docName = ${postTitle}-${id}
;
let date = new Date(); // for published at info
//access firstore with db variable;
db.collection("posts").doc(docName).set({ <-the .collection at this instance is throwing a TS2339 error.
title: postTitleField.value,
article: articleField.value,
bannerImage: bannerPath,
publishedAt: `${date.getDate()} ${months[date.getMonth()]} ${date.getFullYear()}`
})
.then(() => {
location.href = `/${docName}`;
})
.catch((err) => {
console.error(err);
})
}
})
I was curious if you had run into this at all and knew a solution. My imports for this component are:
import { Component, OnInit, OnDestroy } from '@angular/core';
import { initializeApp } from "firebase/app";
import { getFirestore, collection, getDocs } from 'firebase/firestore/lite';
import 'firebase/compat/functions'
import 'firebase/compat/firestore'
import 'firebase/compat/database'
import { environment } from 'src/environments/environment.prod';
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.