Skip to content

Instantly share code, notes, and snippets.

@kvedantmahajan
Created July 27, 2017 07:13
Show Gist options
  • Save kvedantmahajan/7f9c31bebace6cf6cb2f6e706fbeb7f8 to your computer and use it in GitHub Desktop.
Save kvedantmahajan/7f9c31bebace6cf6cb2f6e706fbeb7f8 to your computer and use it in GitHub Desktop.
'use strict';
const express = require('express');
const router = express.Router();
router.get('/', function(req, res) {
res.json([
{
id: 1,
title: 'First note',
text: 'Sample text'
},
{
id: 2,
title: 'Second note',
text: 'Sample text'
}
]);
});
router.post('/', function(req, res) {
res.send({
code: 1
});
});
module.exports = router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment