$ git clone https://github.com/mydream19/firebase_moderate_image.git
$ cd firebase_moderate_image
$ firebase login
$ cd functions
$ npm install
$ cd ..
$ firebase deploy --only functions
Get started: write and deploy your first functions
$ npm install -g firebase-tools
$ firebase login
$ firebase init
? Select a default Firebase project for this directory:
profile-final-test (Profile-FINAL-TEST)
? What language would you like to use to write Cloud Functions?
Javascript
? Do you want to use ESLint to catch probable bugs and enforce style? (y/N) y
? Do you want to install dependencies with npm now? (Y/n) y
- Change
ecmaVersion
to 8 from 6 infunctions/.eslintrc.json
line 4. - Add node engine in
package.json
"engines": {
"node": "8"
},
Add a following code in function/index.js
at line 37.
return null;
$ firebase deploy --only functions
Go to the Firebase Console Storage
tab and upload an image that contains adult or violent content. After a short time the image will be replaced by a blurred version of itself.
You can check with this image flesh eating Zombie