Skip to content

Instantly share code, notes, and snippets.

View henryboldi's full-sized avatar
🐶

Henry Boldizsar henryboldi

🐶
View GitHub Profile
/**
* Bootstrap
*
* An asynchronous boostrap function that runs before your Sails app gets lifted.
* This gives you an opportunity to set up your data model, run jobs, or perform some special logic.
*
* For more information on bootstrapping your app, check out:
* http://sailsjs.org/#documentation
*/
if (environment === 'development') { db_connection = {
module : 'sails-mongo',
url: process.env.DB_URL,
schema: true
}} else if (environment === 'production'){ db_connection = {
module: 'sails-mongo',
url: 'mongodb://1hackerbracket1:[email protected]:10479/hackerbracket',
module.exports = {
port: process.env.PORT || 1337,
environment: process.env.NODE_ENV || 'development',
adparters: {
'default': 'mongo',
mongo: {
show: function (req, res, next){
Hacks.findOne(req.param('id'), function foundHack(err, hack){
if(err) return next(err);
if (!hack) return next();
User.findOne(hack.owner, function foundUser(err, user){
if(err) return next(err);
if (!user) return next();
Comment.find({postID: hack.id}).sort('createdAt ASC').exec(function foundHack(err, comment){
if(err) return next(err);
if (!comment) return next();
warn: (to silence this warning, change `config/express.js`)
/Users/henry/Documents/dev/node/hackerbracket/node_modules/sails-mongo/node_modules/mongodb/lib/mongodb/connection/base.js:242
throw message;
^
TypeError: Object #<ServerResponse> has no method 'notFound'
at found (/Users/henry/Documents/dev/node/hackerbracket/node_modules/sails/lib/hooks/blueprints/actions/find.js:86:35)
at bound (/Users/henry/Documents/dev/node/hackerbracket/node_modules/lodash/dist/lodash.js:957:21)
at applyInOriginalCtx (/Users/henry/Documents/dev/node/hackerbracket/node_modules/sails/node_modules/waterline/lib/waterline/utils/normalize.js:362:80)
* For more information on adapter configuration, check out:
* http://sailsjs.org/#documentation
*/
module.exports.adapters = {
// // If you leave the adapter config unspecified
// // in a model definition, 'default' will be used.
'default': 'mongo',
Warning: connection.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.
One of your models (Comment) doesn't have a connection.
Do you have a default `connection` in your `config/models.js` file?
Warning: connection.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.
One of your models (Comment) doesn't have a connection.
Do you have a default `connection` in your `config/models.js` file?
These are the logs for 107.170.207.198.
In the mean time, for alternatives and more info, check out:
-> https://gist.github.com/mikermcneil/8249181
-> https://github.com/senchalabs/connect/wiki/Connect-3.0
(to silence this warning, change `config/express.js`)
Error rendering view at :: /fortheon/source/views/hacks/recent
with layout located at :: /fortheon/source/views/layout
TypeError: /fortheon/source/views/hacks/recent.ejs:23
21|
Post a Hack
/**
* Global adapter config
*
* The `adapters` configuration object lets you create different global "saved settings"
* that you can mix and match in your models. The `default` option indicates which
* "saved setting" should be used if a model doesn't have an adapter specified.
*
* Keep in mind that options you define directly in your model definitions
* will override these settings.
*
bugRepot: function(req, res){
var bugObj = {
browserInfo: req.param('browserInfo'),
message: req.param('message'),
}
var smtpTransport = nodemailer.createTransport("SMTP",{
service: "Mandrill",
auth: {