Last active
December 29, 2017 17:47
-
-
Save wharley/9a60e22049cd188077e686d7cdc60ce2 to your computer and use it in GitHub Desktop.
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
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