Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alvagi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
alvagi
Commits
d28556a7
Commit
d28556a7
authored
Jun 10, 2015
by
antirek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change createServer
parent
0ec9af17
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
15 deletions
+25
-15
app.js
app.js
+8
-5
index.js
lib/index.js
+17
-10
No files found.
app.js
View file @
d28556a7
var
ding
=
require
(
'
./lib/index
'
);
var
AGIServer
=
require
(
'
./lib/index
'
);
var
handler
=
function
(
context
)
{
var
handler
=
function
(
context
)
{
context
.
onEvent
(
'
variables
'
)
context
.
onEvent
(
'
variables
'
)
.
then
(
function
(
vars
)
{
.
then
(
function
(
vars
)
{
return
context
.
streamFile
(
'
beep
'
);
return
context
.
streamFile
(
'
beep
'
);
});
});
};
};
ding
.
createServer
(
handler
).
listen
(
3000
);
var
agi
=
new
AGIServer
(
handler
);
agi
.
start
(
3000
);
//ding.createServer(handler).listen(3000);
lib/index.js
View file @
d28556a7
var
Context
=
require
(
'
./context
'
);
var
Context
=
require
(
'
./context
'
);
var
agi
=
{
var
agi
=
function
(
handler
)
{
state
:
require
(
'
./state
'
),
Context
:
Context
,
var
server
;
createServer
:
function
(
handler
)
{
return
require
(
'
net
'
).
createServer
(
function
(
stream
)
{
var
handle
=
function
(
stream
)
{
var
context
=
new
Context
(
stream
);
var
context
=
new
Context
(
stream
);
handler
(
context
);
handler
(
context
);
});
};
}
var
start
=
function
(
port
)
{
server
=
require
(
'
net
'
).
createServer
(
handle
).
listen
(
port
);
};
return
{
start
:
start
};
};
};
module
.
exports
=
agi
;
module
.
exports
=
agi
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment