Giter Site home page Giter Site logo

deployd-heroku-demo's People

Contributors

nicolasritouet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

deployd-heroku-demo's Issues

Improve UI

index.html is really minimal, we need:

  • show examples how to use the API

Created data failed

I used "request-promise" to create one data, but it failed.
And after I created data with the dashboard , it always be loading, bug "get" was successfully.

{"name":"StatusCodeError","statusCode":400,"message":"400 - {"errors":{"questions":"is required","userId":"is required"},"status":400}","error":"{"errors":{"questions":"is required","userId":"is required"},"status":400}","options":{"uri":"http://127.0.0.1:3000/surveys","data":{"userId":"1801481404f95868","questions":"[]"},"method":"POST","simple":true,"resolveWithFullResponse":false},"response":{"statusCode":400,"body":"{\"errors\":{\"questions\":\"is required","userId":"is required"},"status":400}","headers":{"x-powered-by":"Express","set-cookie":["sid=c437fe6e3ab2937c7b7c79b86e9fa9bf8e1dfc04b6f1361e4033324354098a06b54d0d312222c4291b81b3c28326220152851c6ca7f1257efea5de4347163334; path=/; httponly"],"content-type":"application/json","date":"Mon, 12 Oct 2015 09:21:47 GMT","connection":"close","transfer-encoding":"chunked"},"request":{"uri":{"protocol":"http:","slashes":true,"auth":null,"host":"127.0.0.1:3000","port":"3000","hostname":"127.0.0.1","hash":null,"search":null,"query":null,"pathname":"/surveys","path":"/surveys","href":"http://127.0.0.1:3000/surveys"},"method":"POST","headers":{"content-length":0}}}}

Here is code (server.js) ///////////////////////////////////////////

var express = require('express');
var http = require('http');
var bodyParser = require('body-parser');
var nodeExcel = require('excel-export');
var rp = require('request-promise');
var swig = require('swig');

var serverPort = process.env.PORT || 3000;
var nodeEnv = process.env.NODE_ENV || 'development';

// setup express
var app = exports.app = express();

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: true
}));

app.engine('html', swig.renderFile);
app.set('view engine', 'html');
app.set('view cache', false);

var server = http.createServer(app);

// Define a new route
app.get('/hello-express', function (req, res) {

rp.post({
  uri: 'http://127.0.0.1:3000/surveys',
  formData: {
    userId: '1801481404f95868',
    questions: "[]"
  }
}).then(function (resp) {
    return res.send(resp);
  })
  .catch(function (err) {
    return res.send(err);
  })

});

// setup deployd
require('deployd').attach(server, {
env: nodeEnv,
db: {
connectionString: 'mongodb://127.0.0.1:27017/web1'
}
});

app.use(server.handleRequest);

// start server
server.listen(serverPort, function() {
var serverAddr = server.address().address == '0.0.0.0' ? 'localhost' : server.address().address;
console.log('Express & Deployd started.\n\nPlease visit http://%s:%s', serverAddr, server.address().port);
});

Please help me!!!

Don't use for production?

When you say:

Don't use for production. This will deploy on Heroku in development mode, without any password to the Dashboard. I'm working on a fix.

Is your concern just the dashboard password?

Error getting deployd 0.8.0.rc3 version

Hello Nicolas

Heroku is giving me the following error log

----> Building dependencies
Installing node modules (package.json)
npm ERR! code ENOPACKAGEJSON
npm ERR! package.json Non-registry package missing package.json: deployd@git://github.com/deployd/deployd.git#v0.8.0-rc.3.

If you can help me
Regards
Arvit

Allow key protected dashboard

We need to write the key to a file (.dpd/keys.json) to protect the dashboard. Heroku doesn't allow that.
We need another solution to write the selected key somewhere (env var).
But that would mean modify the core of Deployd.

One question

I was trying to use your example as a guide to deploy my deployd project to heroku, I am using the regular deployd project (deployd would be a node project, not express) I tried to add the server.js file you used and the code was not recognized by the compiler(netBeans) should this example work for any deployd regular project?? The project where I am trying to add the server and user heroku is https://github.com/laugmo/proyectofinal-1.git

I have another option, that would be to use a friend's server, but I would need some help with the project configuration, if you have some practical tips around it it would be much appreciated

Doesn't work now?

Log from heroku attached:

2017-03-12T04:29:34.684675+00:00 app[web.1]: Unhandled rejection TypeError: Cannot read property 'insert' of undefined
2017-03-12T04:29:34.684699+00:00 app[web.1]: at /app/node_modules/deployd/lib/db.js:262:8
2017-03-12T04:29:34.684700+00:00 app[web.1]: at /app/node_modules/deployd/lib/db.js:155:12
2017-03-12T04:29:34.684702+00:00 app[web.1]: at runCallback (timers.js:651:20)
2017-03-12T04:29:34.684702+00:00 app[web.1]: at tryOnImmediate (timers.js:624:5)
2017-03-12T04:29:34.684703+00:00 app[web.1]: at processImmediate [as _immediateCallback] (timers.js:596:5)
2017-03-12T04:29:34.684705+00:00 app[web.1]: From previous event:
2017-03-12T04:29:34.684705+00:00 app[web.1]: at collection (/app/node_modules/deployd/lib/db.js:154:11)
2017-03-12T04:29:34.684706+00:00 app[web.1]: at SessionStore.Store.insert (/app/node_modules/deployd/lib/db.js:261:3)
2017-03-12T04:29:34.684707+00:00 app[web.1]: at SessionStore.createSession (/app/node_modules/deployd/lib/session.js:110:10)
2017-03-12T04:29:34.684708+00:00 app[web.1]: at /app/node_modules/deployd/lib/attach.js:92:23
2017-03-12T04:29:34.684709+00:00 app[web.1]: at /app/node_modules/deployd/lib/util/http.js:64:9
2017-03-12T04:29:34.684709+00:00 app[web.1]: at /app/node_modules/corser/lib/corser.js:99:13
2017-03-12T04:29:34.684710+00:00 app[web.1]: at exports.setup (/app/node_modules/deployd/lib/util/http.js:24:3)
2017-03-12T04:29:34.684711+00:00 app[web.1]: at handleRequest (/app/node_modules/deployd/lib/attach.js:89:5)
2017-03-12T04:29:34.684711+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2017-03-12T04:29:34.684712+00:00 app[web.1]: at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
2017-03-12T04:29:34.684713+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:284:7
2017-03-12T04:29:34.684713+00:00 app[web.1]: at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
2017-03-12T04:29:34.684714+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:275:10)
2017-03-12T04:29:34.684714+00:00 app[web.1]: at expressInit (/app/node_modules/express/lib/middleware/init.js:40:5)
2017-03-12T04:29:34.684715+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2017-03-12T04:29:34.684716+00:00 app[web.1]: at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
2017-03-12T04:29:34.684717+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:284:7
2017-03-12T04:29:34.684717+00:00 app[web.1]: at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
2017-03-12T04:29:34.684718+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:275:10)
2017-03-12T04:30:04.652202+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=immense-thicket-85459.herokuapp.com request_id=04e42a3c-af94-4d2b-91b8-6741cdea010a fwd="5.79.156.244" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0 protocol=https

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.