Parse and Heroku Service(1)Heroku Installation and Play

Parse and Heroic Service(1)Heroku Installation and Play

1 Introduction Parse Service
a. JSON format data mapping to storage
b. PFUser user management
c. iOS and Android push notification
d. File storage

2 Installation of Parse Tool
Command Line Tool
> curl -s https://www.parse.com/downloads/cloud_code/installer.sh | sudo /bin/bash

This will install one file under /usr/local/bin/parse. Verify the installation.
> parse version
3.0.5

Check NodeJS version because I am using NodeJS.
https://nodejs.org/en/download/releases/

Some related versions
https://nodejs.org/download/release/v0.12.2/

Error Message with node package node-sass
npm ERR! node-sass@3.0.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.0.0 postinstall script 'node scripts/build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.

Solution:
> xcode-select --install

> npm install -g npm@latest

These does not help.
> cd /usr/local/lib/

> sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib

This does not help.

Try different version wget https://nodejs.org/dist/v4.4.0/node-v4.4.0.tar.gz

With the version 4.4.0 and upgrade the version of "node-sass": "~3.4.2”, It works pretty well.

3 Heroku Introduction
https://dashboard.heroku.com/apps

Install Heroku Tool Belt
On MAC, just directly download the binary file and install.

On Linux, make sure we already have the ruby there. (why ruby? I just personally do not like ruby that much.)
> ruby --version
ruby 2.0.0p648 (2015-12-16) [x86_64-linux]

For ubuntu
> wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh

For CentOS, just choose the standalone version
> wget -qO- https://toolbelt.heroku.com/install.sh | sh

> echo 'PATH="/usr/local/heroku/bin:$PATH"' >> ~/.profile

> . ~/.profile

Verify the Installation
> heroku version
heroku-toolbelt/3.42.42 (x86_64-darwin10.8.0) ruby/1.9.3
heroku-cli/4.27.26-693efcb (amd64-darwin) go1.6
=== Installed Plugins
heroku-apps@1.2.7
heroku-cli-addons@0.2.1
heroku-fork@4.1.1
heroku-git@2.4.5
heroku-local@4.1.7
heroku-orgs@1.0.4
heroku-pipelines@1.1.1
heroku-run@2.9.2
heroku-spaces@2.0.14
heroku-status@2.1.0

This will login you into the environment.
> heroku login

Find the sample deployment nodeJS project
> git clone https://github.com/heroku/node-js-getting-started.git

Heroku will create a git branch as follow:
> heroku create

Creating app... done, stack is cedar-14
https://glacial-tundra-54782.herokuapp.com/ | https://git.heroku.com/glacial-tundra-54782.git
[ec2-user@ip-172-23-7-212 ipply-server]$
[ec2-user@ip-172-23-7-212 ipply-server]$ git remote -v
heroku https://git.heroku.com/glacial-tundra-54782.git (fetch)
heroku https://git.heroku.com/glacial-tundra-54782.git (push)
origin https://luohuazju@bitbucket.org/jobs2careers/ipply-server.git (fetch)
origin https://luohuazju@bitbucket.org/jobs2careers/ipply-server.git (push)

Push Codes to Remote Heroku
> git push heroku master

Visit the Browser
https://glacial-tundra-54782.herokuapp.com/

Check if the application is running.
> heroku ps:scale web=1
Scaling dynos... done, now running web at 1:Free.

To run that locally,
> node index.js

or

> npm start

Check the logging on Heroku
> heroku logs --tail

Procfile - this is important file, we use that to put the command to start the application
> cat Procfile
web: node index.js

Check the Scala of App
> heroku ps
Free quota left: 17h 24m
=== web (Free): node server.js (1)
web.1: idle 2016/03/17 20:44:14 +0000 (~ 50m ago)

Stop running
> heroku ps:scale web=0

Run the app locally
> heroku local web

Hey, hey, hey, we’ve got a Scala version.
> git clone https://github.com/heroku/scala-getting-started.git

Deploy on heroku, is it using play framework?
> git push heroku master
Counting objects: 169, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (90/90), done.
Writing objects: 100% (169/169), 22.30 KiB | 0 bytes/s, done.
Total 169 (delta 66), reused 168 (delta 66)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Play 2.x - Scala app detected

It seems right.
console: target/universal/stage/bin/play-getting-started -main scala.tools.nsc.MainGenericRunner -usejavacp

stage the project
> sbt package

Run local
> heroku local

Golang on Heroku
I only have an old version of golang.
> go version
go version go1.5.3 darwin/amd64

https://devcenter.heroku.com/articles/getting-started-with-go#introduction

Python
https://devcenter.heroku.com/articles/getting-started-with-python#introduction

Java
https://devcenter.heroku.com/articles/getting-started-with-java#introduction

> git clone https://github.com/heroku/java-getting-started.git

It is using maven3

Stop the running application
> heroku ps:scale web=0

> cat Procfile
web: java -cp target/classes:target/dependency/* Main

References:
http://sillycat.iteye.com/blog/2261001

http://www.cnblogs.com/over140/archive/2013/05/09/3068968.html

http://zenius.iteye.com/blog/1634906

http://zenius.iteye.com/blog/1634911

blog building
http://code.tutsplus.com/zh-hans/tutorials/get-started-building-your-blog-with-parsejs--cms-21997

http://code.tutsplus.com/tutorials/get-started-building-your-blog-with-parsejs-working-with-data--cms-22047

migrate service
http://www.jollen.org/blog/2016/02/how-to-setup-parse-api-server.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值