File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ var ldnode = require ( '../' ) // or require('ldnode')
2+
3+ ldnode
4+ . createServer ( {
5+ webid : true ,
6+ cert : 'path/to/your/ssl/cert' ,
7+ key : 'path/to/your/ssl/key'
8+ } )
9+ . listen ( 3456 , function ( ) {
10+ console . log ( 'started ldp with webid on port ' + 3456 )
11+ } )
Original file line number Diff line number Diff line change 1+ var express = require ( 'express' )
2+ var ldnode = require ( '../' ) // or require('ldnode')
3+
4+ // Starting our express app
5+ var app = express ( )
6+
7+ // My routes
8+ app . get ( '/' , function ( req , res ) {
9+ console . log ( req )
10+ res . send ( 'Welcome to my server!' )
11+ } )
12+
13+ // Mounting ldnode on /ldp
14+ var ldp = ldnode ( )
15+ app . use ( '/ldp' , ldp )
16+
17+ // Starting server
18+ app . listen ( 3000 , function ( ) {
19+ console . log ( 'Server started on port 3000!' )
20+ } )
21+
Original file line number Diff line number Diff line change 1- var express = require ( 'express' )
21var ldnode = require ( '../' ) // or require('ldnode')
32
4- // Starting our express app
5- var app = express ( )
6-
7- // My routes
8- app . get ( '/' , function ( req , res ) {
9- console . log ( req )
10- res . send ( 'Welcome to my server!' )
11- } )
12-
13- // Mounting ldnode on /ldp
14- var ldp = ldnode ( )
15- app . use ( '/ldp' , ldp )
16-
17- // Starting server
18- app . listen ( 3000 , function ( ) {
19- console . log ( 'Server started on port 3000!' )
3+ // Startin ldnode server
4+ var ldp = ldnode . createServer ( )
5+ ldp . listen ( 3456 , function ( ) {
6+ console . log ( 'Starting server on port ' + 3456 )
7+ console . log ( 'LDP will run on /' )
208} )
219
You can’t perform that action at this time.
0 commit comments