Tag Info

New answers tagged

3

You'd be better off using that extra bandwidth to spoon feed the map to the users as they discover it. As you've noticed, anything client side can be easily hacked. You might think of a fancy way to encrypt the data, but you'd still have to send the decrypt keys to the browser. For that matter, you don't really know if you're talking to a browser at all ...


0

Your module would have to either export the static data or assign it to a global. If the module does nothing, then the data will only be local to the module and will not be reachable from outside. Remember that each module is in it's own function scope so declarations in the module that are not exported and simply local variables within that module ...


-1

Just found https://github.com/NaturalNode/natural, which provided a way to measure "Jaro-Winkler Distance" or "String Distance" in this case.


0

An issue with readdir is that it passes in only the filename, without the full path, to the data variable in your index function. Let's say you are calling the script from C:\main. The contents of C:\main are C:\main C:\main\folder1 C:\main\folder1\subDir1 Once your program enters folder1 and reads subDir1, it will try to call readdir with data[i] = ...


0

When you only have two routes, it makes no sense to separate them in this way. However, when you consider a real application with many routes, it begins to make more sense. /routes/user.js var express = require('express'); var router = express.Router(); var User = require('../models/user'); router.get('/', function (req, res, next) { ...



Top 50 recent answers are included