uhray / crud Goto Github PK
View Code? Open in Web Editor NEWcrud api creator
License: MIT License
crud api creator
License: MIT License
currently I am using windows 10 on nodejs version 8.2.1 and express 4.15.5
I dont know if I am doing this wrong, but i followed your simple example from the npm page https://www.npmjs.com/package/node-crud and am having two problems:
when using a suggested fix to change it to
(if !Object.prototype.hasOwnProperty.call(require.extensions,ext))
and using your simple example:
------------------file: index.js --------------
var crud = require('node-crud'),
express = require('express'),
app = express();
// set up some express middleware
app.use(require('body-parser').urlencoded({ extended: true }));
app.use(require('body-parser').json());
// Let's create our first Crud API route
crud.entity('/users').Read()
.use(function(req, res, next) {
// express middleware capability
next();
})
.pipe(function(data, query, cb) {
cb(null, [ { name: 'bobby tables' } ]);
});
crud.launch(app);
express says cannot get "/api/users/"
there are no other errors or messages thrown by this so i dont know whats going on but wanted to let you know that this seems broken on node 8
Hi, not sure whether i'm doing anything wrong here but when I run the node app.js
I'm getting the following error after installing all the dependencies.
hugie-personal-macbook-pro:express hugo$ node app.js
/Users/hugo/projects/express/app.js:11
.entity("/users")
^
TypeError: crud.entity is not a function
at Object.<anonymous> (/Users/hugo/projects/express/app.js:11:4)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
at startup (internal/bootstrap/node.js:201:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)
My app.js file is what's shown here and my package.json includes the following:
"dependencies": {
"crud": "0.0.28",
"express": "^4.16.3",
"express-resource": "^1.0.0",
"mongoose": "^5.1.7",
"node-crud": "^2.1.4"
Unsure whether it's a bug or whether I'm creating the express app wrongly.
Hello,
I've been working on a PR for a feature, but there is no documentation on running tests/coverage or the contributing procedure. (Formatting/Style). I see you have used a linter so hopefully that's sufficient for code style.
Information on running tests would be appreciated. I should note that I've mocha installed globally and ran mocha
to receive an error
D:\Source\Repos\crud\dist\crud.js:418
})(window);
^
ReferenceError: window is not defined
It should be noted that I then tried with jsdom registered (I have this installed globally). This fixes it, of course. But there is no mention of jsdom in your gulpfile. My concern is if my testing method is different to yours my tests are not valid.
Kind regards,
Josh.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.