Created
October 28, 2020 09:16
-
-
Save codebubb/799337799ecb23e7f51e67dcc0b7d621 to your computer and use it in GitHub Desktop.
Beacon and PageVisibility API
This file contains hidden or 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
| const express = require('express'); | |
| const bodyParser = require('body-parser'); | |
| const app = express(); | |
| app.use(bodyParser.text()); | |
| app.use(express.static('public')); | |
| app.post('/log', (req, res) => { | |
| console.log('Received Beacon: ', JSON.parse(req.body)); | |
| }); | |
| app.listen(3000, console.log('App listening...')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment