-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
29 lines (24 loc) · 686 Bytes
/
server.js
File metadata and controls
29 lines (24 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const express = require('express');
const app = express();
const https = require('https');
const fs = require('fs');
const port = 3000;
const options = {
key: fs.readFileSync('./keys/key.pem'),
cert: fs.readFileSync('./keys/cert.pem')
};
const Server = ()=>{
app.post('/receive',(req, res)=>{
console.log('you have got some incoming payment');
res.status(200).send();
});
app.get('/',(req, res)=>{
console.log('get request');
res.status(200).send();
});
https.createServer(options, app)
.listen(port, function () {
console.log('Example app listening on port 3000!')
});
}
module.exports = Server;