-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multiuser 'send message', 'room add' and responses complete
- Loading branch information
Showing
14 changed files
with
570 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
var mongojs = require('mongojs'); | ||
var db = mongojs('sockchat', ['messages','users','rooms']); | ||
var http = require('http'); | ||
var querystring = require('querystring'); | ||
|
||
var confirm = require('confirm-cli'); | ||
/** | ||
* testing script for dev. | ||
* run using "node config/init.js" | ||
**/ | ||
|
||
// confirm('Confirm remove all data?', | ||
// function () { | ||
// db.users.remove({}, (err, dat) => { db.rooms.remove({}, (err, dat) => { db.messages.remove({},(err,dat)=>{ | ||
// console.log('removed'); | ||
|
||
// });});}); | ||
|
||
db.users.remove({}); | ||
db.messages.remove({}); | ||
db.rooms.remove({}); | ||
|
||
// createNewUser('Test Boi', 'testBoi', '[email protected]'); | ||
// createNewUser('Test More', 'testBitMore', '[email protected]'); | ||
// createNewUser('Cool Boi', 'coolboi', '[email protected]'); | ||
// createNewUser('Cool Boi', 'coolboi', '[email protected]', 1); | ||
// }, function () { | ||
// process.exit(); | ||
// }); | ||
|
||
createNewUser('Tameesh Biswas', 'tameeshb', '[email protected]'); | ||
createNewUser('Test More', 'testBitMore', '[email protected]'); | ||
createNewUser('Cool Boi', 'coolboi', '[email protected]'); | ||
createNewUser('Cooler Boi', 'coolerboi', '[email protected]', 1); | ||
|
||
function createNewUser(name, uname, email,last){ | ||
var post_data = querystring.stringify({ | ||
'name': name, | ||
'uname': uname, | ||
'email': email, | ||
'password': 'tam', | ||
'password_': 'tam' | ||
}); | ||
var post_options = { | ||
host: 'localhost', | ||
port: '3000', | ||
path: '/api/register/web', | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
'Content-Length': Buffer.byteLength(post_data) | ||
} | ||
}; | ||
|
||
// Set up the request | ||
var post_req = http.request(post_options, function (res) { | ||
res.setEncoding('utf8'); | ||
res.on('data', function (chunk) { | ||
console.log('Response: ' + chunk); | ||
}); | ||
}); | ||
|
||
// post the data | ||
post_req.write(post_data); | ||
post_req.end(); | ||
// if (last == 1) | ||
// process.exit(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
# Dependencies | ||
- accepts | ||
addressparser | ||
after | ||
array-flatten | ||
arraybuffer.slice | ||
async | ||
async-limiter | ||
aws-sdk | ||
aws-sdk-apis | ||
backo2 | ||
base64-arraybuffer | ||
base64id | ||
basic-auth | ||
bcrypt-nodejs | ||
bcryptjs | ||
better-assert | ||
blob | ||
bluebird | ||
body-parser | ||
bson | ||
buffer-shims | ||
bytes | ||
callsite | ||
colorful | ||
component-bind | ||
component-emitter | ||
component-inherit | ||
confirm-cli | ||
connect-flash | ||
content-disposition | ||
content-type | ||
cookie | ||
cookie-parser | ||
cookie-signature | ||
core-util-is | ||
crc | ||
debug | ||
depd | ||
destroy | ||
directmail | ||
dkim-signer | ||
each-series | ||
ee-first | ||
ejs | ||
encodeurl | ||
encoding | ||
engine.io | ||
engine.io-client | ||
engine.io-parser | ||
es6-promise | ||
escape-html | ||
etag | ||
express | ||
express-mailer | ||
express-messages | ||
express-session | ||
express-validator | ||
fibers | ||
finalhandler | ||
follow-redirects | ||
forwarded | ||
fresh | ||
has-binary2 | ||
has-cors | ||
he | ||
hooks-fixed | ||
http-errors | ||
iconv-lite | ||
indexof | ||
inherits | ||
ipaddr.js | ||
isarray | ||
jquery-ripple | ||
kareem | ||
keypress | ||
lodash | ||
lodash.get | ||
mailcomposer | ||
media-typer | ||
merge-descriptors | ||
method-override | ||
methods | ||
mime | ||
mime-db | ||
mime-types | ||
mimelib | ||
mongodb | ||
mongodb-core | ||
mongojs | ||
mongoose | ||
morgan | ||
mpath | ||
mpromise | ||
mquery | ||
ms | ||
multiple | ||
muri | ||
negotiator | ||
nodemailer | ||
oauth | ||
object-component | ||
on-finished | ||
on-headers | ||
once | ||
openid | ||
parse-mongo-url | ||
parseqs | ||
parseuri | ||
parseurl | ||
passport | ||
passport-facebook | ||
passport-google | ||
passport-http | ||
passport-local | ||
passport-oauth1 | ||
passport-oauth2 | ||
passport-openid | ||
passport-strategy | ||
passport-twitter | ||
path | ||
path-to-regexp | ||
pause | ||
pkginfo | ||
process | ||
process-nextick-args | ||
proxy-addr | ||
public-address | ||
punycode | ||
qs | ||
querystring | ||
rai | ||
random-bytes | ||
range-parser | ||
raw-body | ||
readable-stream | ||
regexp-clone | ||
require_optional | ||
resolve-from | ||
safe-buffer | ||
sax | ||
semver | ||
send | ||
serve-favicon | ||
serve-static | ||
setprototypeof | ||
simplesmtp | ||
sliced | ||
socket.io | ||
socket.io-adapter | ||
socket.io-client | ||
socket.io-parser | ||
statuses | ||
string_decoder | ||
stringbitlength | ||
thunky | ||
to-array | ||
to-mongodb-core | ||
type-is | ||
uid-safe | ||
uid2 | ||
ultron | ||
underscore | ||
unpipe | ||
util | ||
util-deprecate | ||
utils-merge | ||
uws | ||
validator | ||
vary | ||
wait.for | ||
wrappy | ||
ws | ||
xml2js | ||
xmlbuilder | ||
xmldom | ||
xmlhttprequest-ssl | ||
xoauth2 | ||
xtend | ||
xtraverse | ||
yeast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
global.roomsGL_id = {}; | ||
global.roomsGL_name = {}; | ||
global.userGL = {}; | ||
global.roomsGL = []; | ||
global.roomsGL = []; | ||
global.userGL = {}; | ||
//updating roomsGL and usersGL.rooms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.