feathersjs-ecosystem / cli Goto Github PK
View Code? Open in Web Editor NEWThe command line interface for scaffolding Feathers applications
Home Page: https://github.com/feathersjs/feathers
License: MIT License
The command line interface for scaffolding Feathers applications
Home Page: https://github.com/feathersjs/feathers
License: MIT License
The CLI should check for the latest version of the generator and prompt to update whenever it is run.
It would be nice to be able to use the CLI to add properties to existing models.
When i press a key when it prompts for "Description" i got an error:
$ feathers generate
Feathers CLI
? Description
readline.js:925
throw err;
^
TypeError: Cannot read property 'emit' of undefined
at Prompt.inquirer.prompt.prompts.(anonymous function).onKeypress (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/vorpal/dist/ui.js:133:20)
at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:1535:12)
at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:1469:31)
at AnonymousObserver.tryCatcher (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:63:31)
at AutoDetachObserverPrototype.next (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:5782:51)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:1469:31)
at AutoDetachObserver.tryCatcher (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:63:31)
at AutoDetachObserverPrototype.next (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:5782:51)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:1469:31)
at InnerObserver.onNext (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:4306:29)
Fresh installed and updated Linux Mint 17.3
node 4.4.1
npm 3.8.3
feathers-cli 1.2.2
generator-feathers 0.7.0
generator-feathers-plugin 0.6.9
yo 1.7.0
Setup
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
$ nvm install 4.4
$ nvm use 4.4
$ npm install -g yo generator-feathers generator-feathers-plugin feathers-cli
Run: $ feathers generate
Related to: feathersjs/feathers#300. We've seen this come up a few times.
Migrated from feathersjs/feathers#250:
We also have some thoughts around being able to do feathers deploy
or feathers deploy:heroku
and it will deploy your app.
We can start small and just support Heroku but we might want to wrap Otto in the future in order to support easy dev and prod deployments.
A lot of people seem to get hung up because their environment is either a bit broken or isn't setting up really well for Feathers.
A good place to start might be to have a doctor
command that inspects their env when they generate a project. This is what I'm thinking:
This is some of the basic stuff we probably should check.
This is stuff that would be nice but definitely isn't crucial from day one.
feathers.json
is validCLI wont work anymore due to updating node to version 7.1.0
C:\feathers-chat>feathers generate middleware
events.js:160
throw er; // Unhandled 'error' event
^
Error: This socket is closed
at WriteStream.Socket._writeGeneric (net.js:683:19)
at WriteStream.Socket._write (net.js:734:8)
at doWrite (_stream_writable.js:334:12)
at writeOrBuffer (_stream_writable.js:320:5)
at WriteStream.Writable.write (_stream_writable.js:247:11)
at WriteStream.Socket.write (net.js:661:40)
at Console.log (console.js:43:16)
at UI.prompt (C:\Users\Shahab\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\vorpal\dist\ui.js:233:17)
at Vorpal.vorpal._prompt (C:\Users\Shahab\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\vorpal\dist\vorpal.js:612:15)
at UI.attach (C:\Users\Shahab\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\vorpal\dist\ui.js:400:19)
Remove the generate
command, which is currently a shortcut for generate app
. This allows us to accept set application name and directory to create as generate app [app name]
.
Something like feathers generate secret
which at the very least spits out a new secure secret to copy to your .json
config files or .env
or something.
Depending on how we want to handle secret rotation and what shakes out of feathersjs-ecosystem/configuration#24 we might be able to auto-rotate.
Could we update dependencies in the generator?
Package Current Wanted Latest
feathers-configuration 0.2.3 0.2.3 0.3.1
I tried to do it locally. Nothing is broken. The tests were successful.
If a file or folder already exists we should prompt for confirmation of overwriting, unless the -f, --force
flag is passed.
-f, --force
flag to CLII'm having a problem where I can't generate a hook if I specify where the hook should be used. Here is the code I'm running in my feather app root directory. This is straight from the docs
feathers generate hook
? What do you want to call your hook? gravatar
? What type of hook do you need? before hook
? What service is this hook for? user
? What method is this hook for? create
No file was created in this instance above. If I don't specify what method(s) the hook is for, then it generates the hook.
feathers generate hook
? What do you want to call your hook? gravatar
? What type of hook do you need? before hook
? What service is this hook for? user
? What method is this hook for?
create src/services/user/hooks/gravatar.js
create test/services/user/hooks/gravatar.test.js
I just ran npm i -g feathers-cli
so I'm running the latest version. Any ideas?
local@MBP~$ generate service
? What do you want to call your service?
? What type of service do you need? database
? For which database? NeDB
? Does your service require users to be authenticated? No
events.js:141
throw er; // Unhandled 'error' event
^
TypeError: Cannot read property 'toLowerCase' of undefined
at Object.module.exports.string.downcase (/usr/local/lib/node_modules/feathers-cli/node_modules/i/lib/util.js:126:21)
at Object.inflect.camelize (/usr/local/lib/node_modules/feathers-cli/node_modules/i/lib/methods.js:46:24)
at Object.exports.addImport (/usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/lib/transform.js:92:21)
at importService (/usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/service/index.js:14:15)
at module.exports.generators.Base.extend.writing (/usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/service/index.js:171:5)
at Object.<anonymous> (/usr/local/lib/node_modules/feathers-cli/node_modules/yeoman-generator/lib/base.js:431:23)
at /usr/local/lib/node_modules/feathers-cli/node_modules/run-async/index.js:26:25
at new Promise (/usr/local/lib/node_modules/feathers-cli/node_modules/core-js/modules/es6.promise.js:191:7)
at /usr/local/lib/node_modules/feathers-cli/node_modules/run-async/index.js:25:19
at /usr/local/lib/node_modules/feathers-cli/node_modules/yeoman-generator/lib/base.js:432:9
From feathersjs/feathers#288:
"I'm getting this warning after installing feathers:
└─┬ [email protected]
└── UNMET PEER DEPENDENCY yo@>=1.0.0
npm WARN [email protected] requires a peer of yo@>=1.0.0 but none was installed.
Sorry if the fix is obvious, I'm a novice. I haven't been able to find a solution on the internet or by myself (I tried to update feathers-cli and yo manually and stuff like that...)."
It's really annoying to have to cmd+c to exit the process that fathers-cli starts up. Please make this transactional, not continuous.
Hey guys, great work on everything so far. Now that the official feathers-rethinkdb adapter is out, I would like to get the support added to the new project creation and service generator. Thanks!
ceero
I was wondering if this feature was already implemented. I can't find anything online about it. If so, what's the command? If there is no command, what would be the safest way to remove a service?
Here's a copy of my terminal output:
$ feathers generate service
? What do you want to call your service? user
? What type of service do you need? database
? For which database? MongoDB
? Does your service require users to be authenticated? Yes
events.js:160
throw er; // Unhandled 'error' event
^
TypeError: /usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/model/templates/mongoose.js:11
9| const Schema = mongoose.Schema;
10|
>> 11| const <%= name %>Schema = new Schema({<% if(name === 'user') { %><% for (var i = 0; i < providers.length; i++) { %>
12| <% if (providers[i] === 'local') { %>email: {type: String, required: true, unique: true},
13| password: { type: String, required: true },
14| <% } else { %><%= providers[i].name %>Id: { type: String },
Cannot read property 'length' of undefined
at eval (eval at <anonymous> (/usr/local/lib/node_modules/feathers-cli/node_modules/ejs/lib/ejs.js:485:12), <anonymous>:19:37)
at returnedFn (/usr/local/lib/node_modules/feathers-cli/node_modules/ejs/lib/ejs.js:514:17)
at Object.exports.render (/usr/local/lib/node_modules/feathers-cli/node_modules/ejs/lib/ejs.js:316:37)
at copy.process (/usr/local/lib/node_mair-4.local auth [master]$
Currently, choosing MySQL (and likely others) as the database for a new service automatically assumes the usage of Sequelize. Are there any plans to add an option, either via CLI or project config variable, to generate services that use Knex instead?
It would be nice to be able to use the CLI to add properties to existing models.
Yeoman is a fairly heavy dependency and the cli takes forever to install. It would be nice if we rolled all generator functions directly into the cli project in a more lightweight fashion.
Dash-separated service names should be camelCased where needed:
$ feathers generate service
my-stuff
This will generate hooks.js file with incorrect var names (my-stuffService
):
// Get our initialize service to that we can bind hooks
const my-stuffService = app.service('/v1/my-stuff');
...
To reproduce for me, all I have to do is run feathers generate service
at the top level folder of my application and then give it a name, select generic, and say yes or no to if it needs auth.
I expect to produce a baseline service file and the associated baseline test.
I'm using the latest version of the cli but when I try to generate a new service I get the error as follows:
events.js:141
throw er; // Unhandled 'error' event
^
Error: No function expression found after module.exports
at Object.exports.addLastInFunction (C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\generator-feathers\lib\transform.js:81:11)
at importService (C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\generator-feathers\generators\service\index.js:16:15)
at module.exports.generators.Base.extend.writing (C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\generator-feathers\generators\service\index.js:171:5)
at Object.<anonymous> (C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\yeoman-generator\lib\base.js:439:23)
at C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\run-async\index.js:26:25
at new Promise (C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\core-js\modules\es6.promise.js:191:7)
at C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\run-async\index.js:25:19
at C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\yeoman-generator\lib\base.js:440:9
at processImmediate [as _immediateCallback] (timers.js:383:17)
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working):
feathers-cli 1.2.7
NodeJS version:
4.6.0
Operating System:
Windows 10 Pro
Module Loader:
Node
Being new ..today... with Feathers, following the Quick start, I ran feathers generate service
and entered my service name transponder
.
I expect to be able to call http://localhost:3030/transponder
but the call that works is http://localhost:3030/transponders
(note the plural 's')
Bug? My misunderstanding? Are service names to be required in English only?
As described in feathersjs-ecosystem/generator-feathers#139.
Currently in feathers-cli
(which is so awesome thank you all so much), when you generate a application, the default behavior is to serve static content in three places: /
, /favicon.ico
, and any 404 requests. If someone is building a purely backend application to support a mobile app for example, then returning HTML is less ideal than json responses. It'd be great if there was an option to generate a feathers application that serves 404 responses as a JSON payload with an error message as well as an /
response that has authentication turned on by default. I suppose in a typical REST backend application, the /
wouldn't return anything but it could (just a thought), render any documentation embedded inside the application or be further configure to support pointing to a separate documentation server.
Do you guys have any thoughts on this? I'd mark it as super low priority because it's really easy to rip out the static content if need be.
I created a new application with the CLI, and didn't enable any authentication options, because I did not need any of the ones which were present, so no user service was generated.
Eventually, though, I needed one, so I ran feathers generate service
and provided user
as the name.
A MongoDB user
service should be generated
Seems like the template expects you to be running generate app
if the service name is user
, because in this case, providers
was undefined.
? What do you want to call your service? user
? What type of service do you need? database
? For which database? MongoDB
? Does your service require users to be authenticated? Yes
events.js:160
throw er; // Unhandled 'error' event
^
TypeError: /usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/model/templates/mongoose.js:11
9| const Schema = mongoose.Schema;
10|
>> 11| const <%= name %>Schema = new Schema({<% if(name === 'user') { %><% for (var i = 0; i < providers.length; i++) { %>
12| <% if (providers[i] === 'local') { %>email: {type: String, required: true, unique: true},
13| password: { type: String, required: true },
14| <% } else { %><%= providers[i].name %>Id: { type: String },
Cannot read property 'length' of undefined
at eval (eval at compile (/usr/local/lib/node_modules/feathers-cli/node_modules/ejs/lib/ejs.js:481:12), <anonymous>:17:37)
at returnedFn (/usr/local/lib/node_modules/feathers-cli/node_modules/ejs/lib/ejs.js:512:17)
at Object.exports.render (/usr/local/lib/node_modules/feathers-cli/node_modules/ejs/lib/ejs.js:316:37)
at process (/usr/local/lib/node_modules/feathers-cli/node_modules/mem-fs-editor/lib/actions/copy-tpl.js:12:18)
at applyProcessingFunc (/usr/local/lib/node_modules/feathers-cli/node_modules/mem-fs-editor/lib/actions/copy.js:13:16)
at EditionInterface.exports._copySingle (/usr/local/lib/node_modules/feathers-cli/node_modules/mem-fs-editor/lib/actions/copy.js:51:16)
at EditionInterface.exports.copy (/usr/local/lib/node_modules/feathers-cli/node_modules/mem-fs-editor/lib/actions/copy.js:23:17)
at EditionInterface.module.exports [as copyTpl] (/usr/local/lib/node_modules/feathers-cli/node_modules/mem-fs-editor/lib/actions/copy-tpl.js:10:8)
at constructor.writing (/usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/model/index.js:81:13)
at Object.<anonymous> (/usr/local/lib/node_modules/feathers-cli/node_modules/yeoman-generator/lib/base.js:439:23)
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working):
feathers-cli
1.2.7
NodeJS version:
7.3.0
Operating System:
macOS Sierra
Browser Version:
Irrelevant
React Native Version:
N/A
Module Loader:
npm
When generating a new service with the cli, there is no error if you name the service with a hyphen. For example: calling your service test-service
will silently fail.
Start with a new app then use the cli to do the following.
$ feathers generate service
? What do you want to call your service? test-service
? What type of service do you need? generic
? Does your service require users to be authenticated? Yes
$
There is no error and the service is not created.
TLDR - Changing env.lookup()
to env.register(require.resolve('generator-feathers'))
in generate.js seemed to fix this for me. I do not know enough about yeoman to know if this is machine specific or not. Hopefully this helps.
When running any command (generate shown below) I receive the following:
514 ajones:sandbox$feathers generate
feathers$
events.js:154
throw er; // Unhandled 'error' event
^
Error: You don't seem to have a generator with the name feathers:app installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 0 registered generators run yo with the `--help` option.
at Environment.create (/Users/ajones/git/forks/feathers-cli/node_modules/yeoman-environment/lib/environment.js:296:7)
at Environment.run (/Users/ajones/git/forks/feathers-cli/node_modules/yeoman-environment/lib/environment.js:364:24)
at CommandInstance.<anonymous> (/Users/ajones/git/forks/feathers-cli/lib/commands/generate.js:10:9)
at EventEmitter.session.execCommandSet (/Users/ajones/git/forks/feathers-cli/node_modules/vorpal/dist/session.js:470:20)
at EventEmitter.vorpal._exec (/Users/ajones/git/forks/feathers-cli/node_modules/vorpal/dist/vorpal.js:956:18)
at EventEmitter.vorpal._execQueueItem (/Users/ajones/git/forks/feathers-cli/node_modules/vorpal/dist/vorpal.js:747:17)
at EventEmitter.vorpal._queueHandler (/Users/ajones/git/forks/feathers-cli/node_modules/vorpal/dist/vorpal.js:731:10)
at EventEmitter.vorpal.exec (/Users/ajones/git/forks/feathers-cli/node_modules/vorpal/dist/vorpal.js:678:10)
at EventEmitter.Vorpal.parse (/Users/ajones/git/forks/feathers-cli/node_modules/vorpal/dist/vorpal.js:163:12)
at exports.default (/Users/ajones/git/forks/feathers-cli/lib/index.js:14:40)
running yo --help
shows that I do have them.
Available Generators:
feathers
hook
middleware
model
service
I'd like to do a PR that replaces jshint with eslint.
That way, if users change the eslint settings and run the gen, the gen can run eslint --fix and the cli can get custom styled templates for free!
It's a pet peeve of mine that I have to create and cd
into a directory in order to run yeoman. We should do that for people. Less keystrokes FTW!!
Both the two packages have considerable breaking changes.
Rather than assuming NPM we'd like to be able to install generator templates from a Github repo.
It would be nice to make it so the plugin generator gets installed and is automatically available, if that's possible: https://github.com/feathersjs/generator-feathers-plugin
Often the code needs to be tested with access to the database or some other service, thus making neccesary to run the tests in a different environment.
Should the generator provide an ready to use automated testing environment for this?
For example with:
testing.json
config, to run with NODE_ENV=testing mocha
.I'm going to clean up these jshint errors in 2.0.
> jshint src/. test/. --config
src/commands/debug.js: line 19, col 20, 'callback' is defined but never used.
src/commands/debug.js: line 19, col 14, 'args' is defined but never used.
src/commands/deploy.js: line 14, col 20, 'callback' is defined but never used.
src/commands/deploy.js: line 14, col 14, 'args' is defined but never used.
src/commands/deploy.js: line 5, col 7, 'providers' is defined but never used.
src/index.js: line 24, col 40, Strings must use singlequote.
src/index.js: line 58, col 78, Strings must use singlequote.
src/index.js: line 58, col 128, Strings must use singlequote.
src/index.js: line 75, col 9, 'run' was used before it was defined.
src/utils/check-environment.js: line 11, col 25, 'args' is defined but never used.
src/utils/check-environment.js: line 23, col 60, 'error' is not defined.
src/utils/check-for-updates.js: line 6, col 54, Missing semicolon.
src/utils/start-server.js: line 4, col 25, 'args' is defined but never used.
src/utils/update-cli.js: line 3, col 25, 'args' is defined but never used.
14 errors
Looks like Yeoman is bombing:
npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead!
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
/Users/eric/.nvm/versions/node/v6.2.0/lib
└── (empty)
npm ERR! Darwin 15.3.0
npm ERR! argv "/Users/eric/.nvm/versions/node/v6.2.0/bin/node" "/Users/eric/.nvm/versions/node/v6.2.0/bin/npm" "install" "-g" "feathers-cli"
npm ERR! node v6.2.0
npm ERR! npm v3.8.9
npm ERR! path /Users/eric/.nvm/versions/node/v6.2.0/lib/node_modules/feathers-cli/node_modules/yo/lib/cli.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/eric/.nvm/versions/node/v6.2.0/lib/node_modules/feathers-cli/node_modules/yo/lib/cli.js'
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/eric/.nvm/versions/node/v6.2.0/lib/node_modules/feathers-cli/node_modules/yo/lib/cli.js'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /Users/eric/Development/rpm/rpm-mobile/npm-debug.log
npm ERR! code 1
Let it be a service with these hooks
exports.before = {
all: [computeAverage()],
find: [],
get: [],
create: [],
update: [
/*auth.verifyToken(),
auth.populateUser(),
auth.restrictToAuthenticated()
*/
],
patch: [],
remove: []
};
exports.after = {
all: [],
find: [],
get: [],
create: [],
update: [],
patch: [],
remove: []
};
when using feathers generate hook
for this service and choosing before hook for the update method, the genrator will throw the following error
TypeError: Cannot read property 'loc' of null at print (generator-feathers/node_modules/recast/lib/printer.js:72:37) at exports.printComments (generator-feathers/node_modules/recast/lib/comments.js:324:22) at printWithComments (generator-feathers/node_modules/recast/lib/printer.js:61:16) at print (generator-feathers/node_modules/recast/lib/printer.js:66:20) at Printer.print (generator-feathers/node_modules/recast/lib/printer.js:118:21) at Object.print (generator-feathers/node_modules/recast/main.js:6:33) at traverse.pre (generator-feathers/lib/transform.js:33:49) at visit (generator-feathers/node_modules/ast-traverse/ast-traverse.js:16:19) at visit (generator-feathers/node_modules/ast-traverse/ast-traverse.js:29:25) at visit (generator-feathers/node_modules/ast-traverse/ast-traverse.js:32:21)
The following happens when generator-feathers
is bumped but the user is on an older version via feathers-cli
. Following the instructions won't work, as the cli uses its own instance of the module as a local dependency.
$ feathers generate
Feathers CLI
┌──────────────────────────────────────────────────┐
│ Update available: 0.7.0 (current: 0.6.20) │
│ Run npm install -g generator-feathers to update. │
└──────────────────────────────────────────────────┘
? Do you want to update this generator? (Use arrow keys)
❯ Yes (stops the generator and runs npm install -g generator-feathers)
No (continues running the generator)
Get me out of here
Since yarn is way more faster than npm so I think it's a great time to start supporting yarn when generating new feathers app.
I think it's a good idea to detect yarn is installed on the current system and provide an option to use yarn instead of npm when running feathers generate
Currently when you generate an app it prompts you to run npm start
. When in interactive mode that command doesn't work. As we migrate this to be the formal CLI tool we should:
run
or start
commandOnce we are able to disable update notifications from generator-feathers
, we should provide the functionality directly in the cli.
I'll need to revisit this but I think the last time I ran the new CLI it did not put the files inside the newly created directory.
It would be awesome to be able to generate a service to manage file uploads. Maybe even ask wether the user wants to use S3 or just upload to a directory inside public/
.
If the user selects S3, maybe prompt for AWS Key and Secret and then add that to the config file?
Similarly to how git allows you to use the git-x
namespace to extend functionality as needed, feathers-cli should support this too.
For example the generator should be added to bin as feathers-generate
.
This is a low priority issue. After creating a generic
service (no database) the CLI tool won't release the command prompt.
feathers generate service
generic
and, finally, select wether or not you need auth.local@mbp~$
(or whatever your hostname is). Trying to run ls
results in an Invalid command error and displays all available commands.Just hit Ctrl+c to exit manually.
Currently if you create a service using feathers generate service with
Does your service require users to be authenticated? Yes
the following hooks are applied:
all: [
auth.verifyToken(),
auth.populateUser(),
auth.restrictToAuthenticated()
]
The problem is there are no default filters for live events, which exposes a huge security threat for people using generator and not aware of this.
People can just connect to the server unauthorized and catch all created/update/etc. events:
feathers.service('messages').on('updated', function(obj) { console.log(obj); })
The generator should at least add a simple filter to the service like the one from the docs http://docs.feathersjs.com/real-time/filtering.html#filter-examples
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.