Skip to content

Instantly share code, notes, and snippets.

@jraff
Created March 10, 2016 14:03
Show Gist options
  • Save jraff/a675d5a28906c67e895d to your computer and use it in GitHub Desktop.
Save jraff/a675d5a28906c67e895d to your computer and use it in GitHub Desktop.
const feathers = require('feathers');
const sequelize = require('feathers-sequelize');
const User = require('./models/User');
const app = feathers();
app.use('/users', sequelize({ User }));
app.listen(3030);
const path = require('path');
const Sequelize = require('sequelize');
var sequelize = new Sequelize('feathers-app', '', '', {
dialect: 'sqlite',
storage: path.join(__dirname, '../db.sqlite')
});
var User = sequelize.define('user', {
id: {
type: Sequelize.UUID,
defaultValue: Sequelize.UUIDV4,
allowNull: false,
primaryKey: true
},
name: {
type: Sequelize.CHAR,
allowNull: false
}
});
module.exports = User;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment