`
sillycat
  • 浏览: 2550917 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

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
分享到:
评论

相关推荐

    Beginning App Development with Parse and PhoneGap 无水印pdf 0分

    Using Facebook’s Parse as backend service, and Adobe’s PhoneGap (or Cordova) as a mobile development framework, building a highly customizable application is easier than you can imagine. A basic ...

    excel_parse

    python parse and write excel

    CommandScript And XmlParse

    标题“CommandScript And XmlParse”涉及的是一个关于命令脚本处理和XML解析的议题。在这个主题中,我们主要探讨两个核心概念:CommandScript和XmlParse。CommandScript通常指的是使用编程语言编写的一系列命令,...

    Heroku-and-PDO:这是如何在“heroku.com”上使用 PDO 的示例文件

    通过研究提供的“Heroku-and-PDO-master”压缩包中的文件,你可以更深入地了解在Heroku上部署和使用PDO的具体步骤和最佳实践。 总结来说,这个示例文件集合了在Heroku云平台上使用PHP PDO扩展与数据库交互的基础...

    [iOS] Parse 应用开发 (iOS SDK 实现) (英文版)

    Build your applications using Parse iOS which serves as a complete cloud-based backend service Understand and write your code on cloud to minimize the load on the client side Learn how to create your ...

    iOS eCommerce App Development with Parse(Apress,2015).pdf

    iOS eCommerce App Development with Parse uses a real-world app example to teach you how to build a complete eCommerce iPhone app powered by Parse—the most popular and powerful Platform as a Service ...

    JSON2.JS JSON.JS JSON_PARSE.JS

    method and a parse method. The parse method uses the eval method to do the parsing, guarding it with several regular expressions to defend against accidental code execution hazards. On current ...

    一个简单的Golang LINE bot模板和教程如何在Heroku上设置LINE bot API.zip

    - 启动应用:使用`heroku ps:scale web=1`启动应用,确保URL可用。 至此,你已经成功地使用Golang创建了一个简单的LINE Bot并部署到了Heroku上。你可以通过发送消息到这个Bot,看到它如何回复。为了进一步扩展功能...

    Laravel开发-laravel-parse

    在本文中,我们将深入探讨Laravel开发中的一个重要组件——laravel-parse。这是一个专门为Laravel框架设计的Parse SDK桥接器,允许开发者轻松地在Laravel应用程序中集成Parse服务。Parse是一个强大的后端即服务平台...

    Full Stack JavaScript(Apress,2015)

    This is a hands-on book which introduces you to agile JavaScript web and mobile software development using the latest cutting-edge front-end and back-end technologies including: Node.js,... Parse.com...

    Laravel开发-laravel-parse-sdk

    在本文中,我们将深入探讨Laravel开发中的一个重要组件——laravel-parse-sdk。这个SDK是专门为Laravel 5设计的,用于连接和操作Parse服务,它允许开发者在自托管的Parse服务器上存储和管理数据,从而扩展了Laravel...

    h264_parse解析工具

    1. **编码器调试**:当开发新的H.264编码算法时,可以通过h264_parse验证输出的码流是否符合标准,检查NAL单元的正确性和完整性。 2. **播放器开发**:在实现H.264视频播放功能时,可以利用该工具来检测和调试NAL...

    Instagram:Instagram应用程序,与Parse Server集成并部署在Heroku沙箱服务器上。 使用AVFoundation进行视频录制的自定义摄像机视图

    Instagram Instagram App,与Parse Server集成并部署在Heroku沙箱服务器上 花费时间:总共花费40个小时 用户故事 完成以下必需的功能: 用户可以使用Parse身份验证注册以创建新帐户 用户可以登录和注销其帐户 ...

    txt parse java file

    txt parse java file

    airplay隔空投放

    airplay最新的版本了,内面包括airplay.c、airplay_parser.c、airplay_parser.h、plist_parse.c、airplay_parser_callback.c几个重要实现文件,苹果用的二进制文件是binplist,解析已经封装到plist_parse.c里面,新测...

    video_parse.rar

    1. 解压"video_parse.rar"到本地文件夹。 2. 运行"video_parse.exe",可能需要管理员权限。 3. 通过图形用户界面或命令行参数指定输入视频文件(如"test.avi")和输出目录。 4. 触发分帧操作,工具会读取视频文件,...

    Parse Generator.rar

    "Parse Generator.rar" 是一个与编译原理相关的压缩文件,其中包含了名为 "ParGen.exe" 的可执行程序。这个程序通常被用作编译器设计课程或实验中的解析器生成工具。在计算机科学中,编译原理是研究如何将高级编程...

    matlab开发-parse

    在MATLAB开发中,"parse"通常指的是对输入的数据或字符串进行解析,以便提取有用的信息或执行特定操作。MATLAB提供了强大的字符串处理功能,包括正则表达式、字符串数组和函数,来帮助开发者进行复杂的解析任务。在...

    前端开源库-parse5-htmlparser2-tree-adapter

    在`parse5-master`这个压缩包中,很可能包含了parse5库的源码和相关资源,你可以通过阅读源码、查看示例和文档来更深入地理解这个库的工作原理,以及如何有效地使用`parse5-htmlparser2-tree-adapter`。同时,熟悉这...

Global site tag (gtag.js) - Google Analytics