mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-17 12:16:38 +08:00
* Added support for ts2.3 default generic types * Updated find and findOne * Capitalized TypeScript Version * Added missing TypeScript Version: 2.3 * Added TypeScript Version: 2.3 to express-brute-mongo; removed easy-jsend test dependency on mongoose
49 lines
907 B
TypeScript
49 lines
907 B
TypeScript
|
|
|
|
// import mongoose = require('mongoose');
|
|
import express = require('express');
|
|
import jSend = require('easy-jsend');
|
|
|
|
// var schema = new mongoose.Schema({
|
|
// name: {type: String}
|
|
// });
|
|
|
|
// var Model = mongoose.model('model', schema);
|
|
var Model = {};
|
|
|
|
jSend.init({partial: true});
|
|
|
|
var app = express();
|
|
|
|
app.get('/success', function (req, res, next) {
|
|
res.success('Success');
|
|
});
|
|
|
|
app.get('/fail', function (req, res, next) {
|
|
res.fail('fail');
|
|
});
|
|
|
|
app.get('/error', function (req, res, next) {
|
|
res.error('error');
|
|
});
|
|
|
|
app.get('/partial', function (req, res, next) {
|
|
res.partial({
|
|
offset: 10,
|
|
limit: 50,
|
|
count: 100,
|
|
data: []
|
|
});
|
|
});
|
|
|
|
app.get('/partial', function (req, res, next) {
|
|
res.makePartial({
|
|
model: Model,
|
|
search: {},
|
|
opts: {
|
|
limit: 30,
|
|
skip: 10
|
|
},
|
|
result: []
|
|
});
|
|
}); |