제 오픈 소스 프로젝트를 Heroku에 배포하려고 하는데, 정적 HTML과 자바스크립트만으로 매우 간단해야 합니다. 하지만 정적 사이트는 지원하지 않나요? HTML과 자바스크립트 외에는 아무것도 사용하지 않을 계획이라면 시나트라 프로젝트로 만들지 않는 것이 좋습니다.
~/sites/d4-site $ heroku create --stack cedar
Creating quiet-ice-4769... done, stack is cedar
http://quiet-ice-4769.herokuapp.com/ | [email protected]:quiet-ice-4769.git
Git remote heroku added
~/sites/d4-site $ git remote -v
heroku [email protected]:quiet-ice-4769.git (fetch)
heroku [email protected]:quiet-ice-4769.git (push)
~/sites/d4-site $ git push heroku master
Counting objects: 53, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (49/49), done.
Writing objects: 100% (53/53), 206.08 KiB, done.
Total 53 (delta 4), reused 0 (delta 0)
-----> Heroku receiving push
-----> Removing .DS_Store files
! Heroku push rejected, no Cedar-supported app detected
간단한 방법은 HTML 앱을 PHP 앱으로 가장하는 것입니다. Heroku는 PHP 앱을 올바르게 식별합니다.
index.html 파일의 이름을 home.html로 바꿉니다.
index.php 파일을 생성하고 항목 html 파일을 포함합니다. HTML 항목 파일의 이름이 권장하는 대로 home.html인 경우 index.php는 다음과 같아야 합니다:
<?php include_once("home.html"); ?>
푸시하려는 컴퓨터의 명령줄에 다음과 같이 입력합니다:
git add . git commit -m '당신의 커밋 메시지' git push heroku master
이제 Heroku가 앱을 PHP 앱으로 올바르게 감지해야 합니다:
-----> PHP app detected
-----> Bundling Apache version 2.2.22
-----> Bundling PHP version 5.3.10
-----> Discovering process types
Procfile declares types -> (none)
Default types for PHP -> web
-----> Compiled slug size: 9.9MB
-----> Launching... done, v3
...
블로그 게시물을 보내주신 lemiffe에게 감사드립니다: http://www.lemiffe.com/how-to-deploy-a-static-page-to-heroku-the-easy-way/
이것은 더욱 세련된 방법: [하프] 라는 파일을 사용할 수 있는 '알' 추가하기만 파커게.j슨 헤로쿠 (https://harpjs.com/) 를 서버:
{
"name": "my-static-site",
"version": "1.0.0",
"description": "This will load any static html site",
"scripts": {
"start": "harp server --port $PORT"
},
"dependencies": {
"harp": "*"
}
}
그리고 구축을 헤로쿠. 완료!
랙을 사용하여 이 작업을 수행할 수 있습니다:
https://devcenter.heroku.com/articles/static-sites-on-heroku
또는 시나트라를 사용하는 옥토프레스/지킬과 같은 것을 사용할 수 있습니다.
하지만 HTML 정적 콘텐츠를 제공하려면 최소한의 스택이 필요합니다.
다음은 어떤 방법이 주효했는가 가져다줄래요:
cd myProject
git init
heroku create myApp
heroku git:remote -a myApp
',' 는 '맹자사믈 만들 경우 진입점이 이네스.프프' 이 한 줄의 내용:
<?php include_once("main.html"); ?>
그리고 다음 단계를 수행합니다.
echo '{}' > composer.json
git add .
git commit -am "first commit"
git push heroku master
지금 온라인 (http://myApp.herokuapp.com/) 및 사용자의 앱 documentum. 합니다.
정적 웹 사이트 있으면 스크립트루트 dell. '함께' (say), now you want to 디플로이 迈向 헤로쿠 index. html, 어떻게? < br> < br>;;; "' 깃 (git) 을 초기화 # init 은 git 리포 깃 (git) 을 추가 - a # 파일을 추가합니다. 깃 (git) - m " 커밋합니다 init commit"; # 커밋합니다 파일
터치 콤프로저.j슨 터치 이네스.프프
< include_once (index.html" ";), php,? >,?
{} "' 깃 (git) '와' 지금은 단순히 실행하십시오 누름식 헤로쿠 마스터에는 you& # 39, re 완료!
이 싸움은 그러니까말이야 조금 오래된 하지만 나는 이 작은 랙뿐만 응용 프로그램을 사용하여 됐지, 기본적으로 그 빈 험프 구축할 수 있게 된다 (html, css, js 이미지를) 공용 폴더 전체를 경배하되 부트해 몇 줄의 루비:
require 'vienna'
run Vienna
또한 이 를 구축하기 위한 헤로쿠 험프리리 만들어야 합니다.
source 'https://rubygems.org'
gem 'rack'
gem 'vienna'
이 경우, 설치, 번들화 실행하십시오 don& # 39 에 설치된 도망쳐야해 털미널 컴팩트형 번들화 없다.
sudo gem install bundle
그리고 그게 대한 자세한 내용은 꽤 많은 것을 할 수 있습니다. http://kmikael.com/2013/05/28/creating-static-sites-in-ruby-with-rack/
이 단계를 준수하십시오
콤프로저.j슨 이네스.프프 index. html '유형' 터치
<?php include_once("index.html"); ?>
또한 콤프로저.j슨 문자 {}
git add .
git commit -m "[your message]"
git push ['yourrepo'] ['yourbranch']
뭐, HTML, CSS, 자바스크립트를 사용할 때마다 사용자의 Web-page& # 39 의 예언자들이니, 불과 2 단계:
한 줄 수 있도록 파일 이름으로, 스타일시트가 &, 스크립트입니다 index. html (렉시한테서 브레이스잉 항목이없습니다) 예: 바디입니다.
이러한 파일, 복사, 붙여넣기 이와 같은 변화는 이제 변경하십시오 도메인을 이네스.프프 파일
그럼 상에 배포할 헤로쿠.
따라서 웹 페이지 구축에 데 도움이 되는 방법