Giter Site home page Giter Site logo

crud's People

Contributors

designeng avatar etwark avatar nevercast avatar nschappl avatar rthomps7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crud's Issues

require-dir is broken and cannot get "/api/users"

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:

  1. require-dir is broken at file .\index.js line 93:
    if( !require.extensions.hasOwnPropterty(ext))

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);

app.listen(3000);

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

Unable to run the sample app

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.

Contributing and Testing notes missing.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.