Skip to content

Commit

Permalink
Updated server bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
andersevenrud committed Jan 8, 2021
1 parent 3c1955b commit ae301bb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = (core, proc) => {

return {
// When server initializes
init: async () => {
async init() {
// HTTP Route example (see index.js)
routeAuthenticated('POST', proc.resource('/test'), (req, res) => {
res.json({hello: 'World'});
Expand All @@ -48,13 +48,15 @@ module.exports = (core, proc) => {
},

// When server starts
start: () => {},
async start() {
},

// When server goes down
destroy: () => {},
destroy() {
},

// When using an internally bound websocket, messages comes here
onmessage: (ws, respond, args) => {
onmessage(ws, respond, args) {
respond('Pong');
}
};
Expand Down

0 comments on commit ae301bb

Please sign in to comment.