1
0
Fork 0
mirror of synced 2024-06-27 18:40:42 +12:00

events for web apps built and web apps deployed

This commit is contained in:
Martin McKeaveney 2020-07-15 17:25:08 +01:00
parent 0d0ffeb530
commit 64d1bd5322
5 changed files with 23 additions and 0 deletions

View file

@ -12,7 +12,12 @@ function captureException(err) {
Sentry.captureException(err)
}
function captureEvent(event) {
posthog.capture(event)
}
export default {
activate,
captureException,
captureEvent,
}

View file

@ -6,6 +6,7 @@
import { getContext } from "svelte"
import { fade } from "svelte/transition"
import { post } from "builderStore/api"
import analytics from "../../analytics"
const { open, close } = getContext("simple-modal")
@ -38,6 +39,10 @@
const res = await response.json()
analytics.captureEvent("web_app_created", {
name,
description,
})
$goto(`./${res._id}`)
} catch (error) {
console.error(error)

View file

@ -26,6 +26,9 @@
notifier.success(`Your Deployment is Complete.`)
deployed = true
loading = false
analytics.captureEvent("deployment", {
appId,
})
} catch (err) {
analytics.captureException(err)
notifier.danger("Deployment unsuccessful. Please try again later.")

View file

@ -46,3 +46,8 @@ module.exports = async port => {
const server = http.createServer(app.callback())
return server.listen(serverPort || 4001)
}
process.on("SIGINT", function() {
console.log("\nGracefully shutting down from SIGINT")
process.exit(1)
})

View file

@ -20,3 +20,8 @@ async function runServer() {
}
runServer()
process.on("SIGINT", function() {
console.log("\nGracefully shutting down from SIGINT")
process.exit(1)
})