是否可以将简单的 html 和 javascript 文件结构上传到 heroku? [英] Is it possible to upload a simple html and javascript file structure to heroku?

查看:15
本文介绍了是否可以将简单的 html 和 javascript 文件结构上传到 heroku?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的一个开源项目部署到 heroku,它必须非常简单,只有静态 html 和 javascript.但是它们不支持静态站点吗?如果我不打算使用 html 和 javascript 以外的任何东西,我宁愿不把它变成 Sinatra 项目.

I'm trying to deploy an open source project of mine to heroku, it is by necessity very simple with just static html and javascript. But do they not support static sites? I'd rather not make it a Sinatra project if I don't plan on ever using anything but html and javascript.

~/sites/d4-site $ heroku create --stack cedar
Creating quiet-ice-4769... done, stack is cedar
http://quiet-ice-4769.herokuapp.com/ | git@heroku.com:quiet-ice-4769.git
Git remote heroku added


~/sites/d4-site $ git remote -v
heroku  git@heroku.com:quiet-ice-4769.git (fetch)
heroku  git@heroku.com: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

推荐答案

你可以使用 rack 来做到这一点:

You can use rack to do this:

https://devcenter.heroku.com/articles/static-sites-在heroku上

或者你可以使用像 Octopress/Jekyll 这样使用 sinatra 的东西.

or you can use something like Octopress/Jekyll who uses sinatra.

但是您需要一个最小堆栈来提供 html 静态内容

But you need a minimum stack to serve html static content

这篇关于是否可以将简单的 html 和 javascript 文件结构上传到 heroku?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆