Skip to content

Instantly share code, notes, and snippets.

@wharley
Last active December 29, 2017 17:47
Show Gist options
  • Save wharley/9a60e22049cd188077e686d7cdc60ce2 to your computer and use it in GitHub Desktop.
Save wharley/9a60e22049cd188077e686d7cdc60ce2 to your computer and use it in GitHub Desktop.
const express = require('express'),
restful = require('node-restful'),
mongoose = restful.mongoose;
const app = express()
const Resource = restful.model('resource', mongoose.Schema({
title: 'string',
year: 'number',
})
.methods(['get', 'post', 'put', 'delete'])
Resource.register(app, '/resources')
app.listen(3000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment