Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't deploy hexo-admin #49

Closed
juno249 opened this issue Jan 18, 2016 · 8 comments
Closed

Can't deploy hexo-admin #49

juno249 opened this issue Jan 18, 2016 · 8 comments

Comments

@juno249
Copy link

juno249 commented Jan 18, 2016

Recently, i wanna to deploy my Blog with this plugin to Heroku.
But, i was not found when i access to http://<domain-name>/admin
Tell me why i can't deploy it?

@jaredly
Copy link
Owner

jaredly commented Jan 19, 2016

hmmm that ought to work. what's your heroku Procfile?

@juno249
Copy link
Author

juno249 commented Jan 19, 2016

when i deployed on localhost 0.0.0.0:4000/admin. Everything is ok. But on Heroku, for example: subdomain-heroku.herokuapp.com/admin. It's not work.

@jaredly
Copy link
Owner

jaredly commented Jan 19, 2016

and you're running locally w/ the Procfile? One possibliity is you're just using static files on heroku.

@huguiqi
Copy link

huguiqi commented Mar 11, 2016

Recently, i wanna to deploy my Blog with this plugin to Heroku too.tell me why?thanks...

@wykydtronik
Copy link

no documentation on how to configure deploy? I am using hexo-deployer-git - what do?

@jaredly
Copy link
Owner

jaredly commented Mar 16, 2016

@Kaichi @huguiqi there are two ways to deploy hexo: static pages or as a running server.

  • static pages: you run hexo generate locally, and then the resulting HTML & CSS files are hosted somewhere
  • running server: the host (like heroku) runs hexo server, and pages are generated dynamically

I personally recommend static pages, because it is much cheaper and more efficient. However, when using static pages, hexo-admin is not accessible from your website, but is only accessible locally.
If you are using a running server for your website, then hexo-admin will be available at e.g. example.com/admin, and you will be able to edit blog posts from the running server without having to redeploy.

Which scenario are you asking about?

@jaredly
Copy link
Owner

jaredly commented Nov 18, 2016

to deploy dynamically to heroku, I imagine you would just need a Procfile like

web: hexo server

and then deploy heroku normally, the way explained in https://devcenter.heroku.com/articles/getting-started-with-nodejs#introduction

@jjalan
Copy link

jjalan commented Dec 31, 2016

I solved it as follows:

  1. Create index.js file in root directory of your project that contains the following:
var exec = require('child_process').exec;

var port = process.env.PORT || 4000;
var hexoServerProcess = exec("hexo server -p " + port);

hexoServerProcess.stdout.on('data', function(data) {
    console.log(data.toString()); 
});
  1. Add following line in package.json
"scripts": {
    "start": "node index.js"
  }
  1. Now deploy using (do not use hexo heroku plugin as it only deploy static pages)
git push heroku master

This assumes that you have added heroku as remote pointing to your heroku git.

Working link to my admin:
http://blog.trysquad.com/admin

Complete details (end to end):
http://blog.trysquad.com/2016/12/31/Easiest-way-to-start-hexo-blog-for-your-website/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants