This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Waterline = require('waterline'); | |
var sailsMemoryAdapter = require('sails-memory'); | |
// Create the waterline instance. | |
var waterline = new Waterline(); | |
// Create a specification for a User model. | |
var userCollection = Waterline.Collection.extend({ | |
identity: 'user', | |
connection: 'default', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Waterline = require('waterline'); | |
var sailsMemoryAdapter = require('sails-memory'); | |
var wPsql = require('waterline-postgresql'); | |
// Create the waterline instance. | |
var waterline = new Waterline(); | |
// Create a specification for a User model. | |
var userCollection = Waterline.Collection.extend({ | |
identity: 'user', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Knex from 'knex' | |
import _ from 'lodash' | |
import camelize from 'camelize' | |
import WaterlineSequel from 'waterline-sequel' | |
import KnexPostgis from 'knex-postgis' | |
import WaterlineError from 'waterline-errors' | |
import AdapterError from './error' | |
import Util from './util' | |
import SpatialUtil from './spatial' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ [error: SELEC FROM "user" AS "user" - syntax error at or near "SELEC"] | |
name: 'error', | |
length: 86, | |
severity: 'ERROR', | |
code: '42601', | |
detail: undefined, | |
hint: undefined, | |
position: '1', | |
internalPosition: undefined, | |
internalQuery: undefined, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "thermal-comfort-system-api", | |
"version": "1.0.0", | |
"private": true, | |
"description": "Packages for my Thermal comfort system project", | |
"main": "index.js", | |
"scripts": { | |
"start": "./express/bin/express server" | |
}, | |
"repository": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// express/app/controllers/users.js | |
'use strict'; | |
const debug = require('debug')('thermal-monitor:users'); | |
const controller = require('express/lib/wiring/controller'); | |
const models = require('express/app/models'); | |
const User = models.user; | |
const crypto = require('crypto'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// express/app/models/user.js | |
'use strict'; | |
const bcrypt = require('bcrypt'); | |
const Knex = require("knex")({ | |
client: "pg", | |
connection: { | |
host: "localhost", | |
user: "pi", | |
password: "password", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const changepw = (req, res, next) => { | |
debug('Changing password'); | |
let credentials = req.body.passwords; | |
let search = { | |
id: req.params.id, | |
token: req.currentUser.token, | |
}; | |
new User(search).fetch() | |
.then((data) => { | |
if (data) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const bcrypt = require('bcrypt'); | |
const Knex = require("knex")({ | |
client: "pg", | |
connection: { | |
host: "localhost", | |
user: "pi", | |
password: "password", | |
database: "homestatus" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<!doctype html> | |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> | |
<head> | |
<!-- NAME: 1 COLUMN --> | |
<!--[if gte mso 15]> | |
<xml> | |
<o:OfficeDocumentSettings> | |
<o:AllowPNG/> | |
<o:PixelsPerInch>96</o:PixelsPerInch> |
OlderNewer