Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mint-api-news

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mint-api-news - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

dist/graphql/schema/newsSchema.js

5

dist/models/newsModel/index.js

@@ -11,7 +11,6 @@ 'use strict';

title: { type: String, required: true, unique: true },
description: [],
image: String,
description: [],
url: { type: String, required: true },
source: { type: String, required: true },
link: { type: String, required: true },
status: { type: Boolean, default: true },
createdAt: { type: Date, default: Date.now },

@@ -18,0 +17,0 @@ updatedAt: { type: Date, default: Date.now }

66

dist/routes.js

@@ -11,38 +11,46 @@ 'use strict';

var _newsController = require('./controllers/newsController');
var _mongoose = require('mongoose');
var _newsController2 = _interopRequireDefault(_newsController);
var _mongoose2 = _interopRequireDefault(_mongoose);
var _expressGraphql = require('express-graphql');
var _expressGraphql2 = _interopRequireDefault(_expressGraphql);
var _newsSchema = require('./graphql/schema/newsSchema');
var _newsSchema2 = _interopRequireDefault(_newsSchema);
var _newsModel = require('./models/newsModel');
var _newsModel2 = _interopRequireDefault(_newsModel);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var router = _express2.default.Router({ mergeParams: true });
_mongoose2.default.Promise = global.Promise;
router.get('/news', function (req, res) {
_newsController2.default.list(req.params).then(function (data) {
res.json({
status: true,
data: data
});
}).catch(function (error) {
res.json({
status: false,
error: error
});
});
});
var router = _express2.default.Router();
router.post('/news', function (req, res) {
_newsController2.default.save(req.body).then(function (data) {
res.json({
status: true,
data: data
});
}).catch(function (error) {
res.json({
status: false,
error: error
});
});
});
router.get('/news', (0, _expressGraphql2.default)(function () {
return {
schema: _newsSchema2.default
};
}));
// router.post('/news', (req, res) => {
// NewsController.save(req.body)
// .then((data) => {
// res.json({
// status: true,
// data,
// })
// })
// .catch((error) => {
// res.json({
// status: false,
// error,
// })
// })
// })
exports.default = router;
{
"name": "mint-api-news",
"version": "1.0.7",
"version": "1.0.8",
"main": "./dist/routes.js",

@@ -26,2 +26,4 @@ "scripts": {

"express": "^4.15.3",
"express-graphql": "^0.6.11",
"graphql": "^0.12.3",
"lodash": "^4.17.4",

@@ -28,0 +30,0 @@ "mongoose": "^4.11.3",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc