Skip to content

jerryjj/serverless-microblog

Repository files navigation

Serverless MicroBlog

This is an example project to demonstrate serverless coding with Firebase. Demo: https://micro.totallyon.me/

Local development

  1. Clone the repo
  2. Install dependencies
npm install && bower install
  1. Insert your Firebase Database credentials here (in this README):
FIREBASE_PROJECT_ID: MY-PROJECT-ID
FIREBASE_API_KEY: MY-API-KEY

Or you can also export them as environment variables

export FIREBASE_PROJECT_ID=MY-PROJECT-ID
export FIREBASE_API_KEY=MY-API-KEY
  1. Run the dev server with livereload
npm run dev

Deployment

Requirements:

  • Firebase CLI tool (npm install -g firebase-tools)

To deploy this under your own Firebase project, create .firebaserc -file in the project directory with following content:

{
  "projects": {
    "default": "YOUR_PROJECT_ID"
  }
}

Then build the assets and deploy to hosting:

npm run deploy

Also you can deploy better rules (database.rules.json) for the database (Recommended)

firebase deploy --only database

License: MIT

About

Demo Project for serverless coding with Firebase

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published