Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김민욱
/
Slack Jokebot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
1
Network
Create a new issue
Commits
Issue Boards
Authored by
김연준
2019-05-31 09:56:41 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e72f135f12718ac8467359db671b92e92f9610b5
e72f135f
1 parent
315aa581
Erasing mongoose after failing /change of slight needed codes
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
5 deletions
Routers/route.js
db_control.js
index.js
Routers/route.js
View file @
e72f135
...
...
@@ -9,7 +9,7 @@ exports.startbot = ()=>{
// Get authorization to use the slackbot
const
bot
=
new
SlackBot
({
//xoxb-582582124755-587875604934-gdWsVhzGXCze3mECWXpTsAP6
token
:
""
,
token
:
"
xoxb-582582124755-587875604934-gdWsVhzGXCze3mECWXpTsAP6
"
,
name
:
"Joker"
});
...
...
db_control.js
View file @
e72f135
...
...
@@ -2,6 +2,7 @@ const MongoClient = require('mongodb').MongoClient;
const
jokedoc
=
require
(
'./joke_data/jokes.json'
);
const
dbname
=
'jokeapi'
;
const
collec
=
'jokes'
;
const
dboperation
=
require
(
'./operations'
);
var
url
=
"mongodb://localhost:27017/jokeapi"
;
...
...
index.js
View file @
e72f135
const
route
=
require
(
'./Routers/route'
);
const
mongoose
=
require
(
'mongoose'
);
//Before activating must connect to mongodb to interface
//Connecting code [mongod --dbpath=data --bind_ip 127.0.0.1] at mongodb directory
mongoose
.
connect
(
'mongodb://27017/Joker'
,
{
useNewUrlParser
:
true
})
.
then
(()
=>
console
.
log
(
'mongodb connected'
))
.
catch
(
err
=>
console
.
log
(
err
));
route
.
startbot
();
...
...
Please
register
or
login
to post a comment