Day 77: 07 November 2020
"Well begun is half done"Aristotle
There is a lot of repeated code because I tried to write an immediate solution that would allow me to pass the tests and I did not do any refactoring.
For the moment the last two tests fail.
With a surge of enthusiasm, I also started the sixth OpenClassRooms project!
This project is about backend programming, so server side.
On the backend programming I have vague memories of a training I did in Sicily on the LAMP stack.
I used Linux, Apache, MySQL and PHP to create my web pages back in 2008.
Today I find myself using the MEAN stack: MongoDB, Express, Angular and Node.js
I start to work right away.
I download the document containing the project specifications and clone the frontend repository...
on the terminal I launch
Happy accidents, nothing insurmountable:
- Missing the python version 2.7 in my PC (I wonder why it needs it);
- The last version of node-sass I had installed was not compatible so I had to uninstall it to be able to put the previous version;
- Many packages have vulnerabilities.
Once I have solved these incompatibilities, I run the command
and visiting the localhost:4200 address the browser FINALLY opens the frontend page.
Perfect. I leave the terminal open with npm start running and I start write the code for the backend.
I create a folder that will contain my backend, I open it and launch the terminal from VSCode:
I initialize the package.json file by running npm init and change the default name index.js to server.js
I start a local Git repository by writing git init
Ended the backend configuration phase, I create the file server.js
And then I write the code of app.js and the schema that will be used as template.
I Played a few hours with the code and Postman.
With enormous satisfaction at 3 a.m. I make the first push on GitHub.
...and I immediately receive an email on my phone...who the hell is GitGuardian?!?!
Looks like, as a real beginner, I just made public my username & password combination for mongoDB.
Delete GitHub repo.
I have to ask my mentor a way to get around this problem, because the project must be made public on GitHub to be delivered… But I don't think I should leave my username and password public…
freeCodeCamp got the answer: "Use the .env File"
**Link to tweet:**