This file contains hidden or 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 Todo = require('../models/todo'); | |
| exports.index = function(req, res) { | |
| Todo.find(function(err, todos) { | |
| res.send({ | |
| todos: todos | |
| }); | |
| }); | |
| }; |
This file contains hidden or 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 express = require('express'); | |
| var mongoose = require('mongoose'); | |
| var path = require('path'); | |
| var app = express(); | |
| mongoose.set('debug', true); | |
| mongoose.connect('mongodb://127.0.0.1/express_ember_example'); | |
| app.set('port', process.env.PORT || 3333); | |
| app.use(express.logger('dev')); |
This file contains hidden or 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 todos = require('./controllers/todos'); | |
| module.exports = function(app) { | |
| app.get('/api/1/todos', todos.index); | |
| app.post('/api/1/todos', todos.create); | |
| app.put('/api/1/todos/:id', todos.update); | |
| app.del('/api/1/todos/:id', todos.destroy); | |
| }; |
This file contains hidden or 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 mongoose = require('mongoose'); | |
| var todoSchema = new mongoose.Schema({ | |
| title: { type: String, required: true }, | |
| is_completed: Boolean | |
| }); | |
| module.exports = mongoose.model('Todo', todoSchema); |
This file contains hidden or 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 express = require('express'); | |
| var mongoose = require('mongoose'); | |
| var path = require('path'); | |
| var app = express(); | |
| mongoose.set('debug', true); | |
| // This is the location of your mongo server, as well as the db name. | |
| mongoose.connect('mongodb://127.0.0.1/express_ember_example'); | |
| app.set('port', process.env.PORT || 3333); |
This file contains hidden or 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
| App.Router.map(function() { | |
| return this.resource('todos', { | |
| path: '/' | |
| }, function() {}); | |
| }); |
This file contains hidden or 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
| DS.RESTAdapter.reopen({ | |
| namespace: 'api/1', | |
| serializer: DS.RESTSerializer.extend({ | |
| primaryKey: function(type) { | |
| return '_id'; | |
| } | |
| }) | |
| }); |
This file contains hidden or 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
| exports.config = | |
| # See http://brunch.io/#documentation for docs. | |
| files: | |
| javascripts: | |
| joinTo: 'app.js': /^(app|vendor|bower_components)/ | |
| order: | |
| before: [ | |
| 'bower_components/jquery/jquery.js' | |
| 'bower_components/handlebars/handlebars.js' | |
| 'bower_components/ember/ember.js' |
This file contains hidden or 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
| # Install the Ruby library | |
| gem install dnsimple-ruby | |
| # Check if a domain is available | |
| DNSimple::Domain.check(your_domain_name) == 'available' | |
| # Register a domain | |
| domain = DNSimple::Domain.register(domain_name) | |
| # Apply a template to your domain |