Created
August 8, 2019 17:05
-
-
Save vsavkin/6961dd59fb619bfe47236052aa5ab521 to your computer and use it in GitHub Desktop.
This file contains 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
import * as express from 'express'; | |
import { Ticket } from '@happyorg/data'; | |
const app = express(); | |
const tickets: Ticket[] = [ | |
{ | |
title: `Install updates`, | |
id: 1 | |
}, | |
{ | |
title: `Restore the backup`, | |
id: 2 | |
} | |
]; | |
app.get('/api/tickets', (req, res) => { | |
res.send(tickets); | |
}); | |
const port = process.env.port || 3333; | |
const server = app.listen(port, () => { | |
console.log(`Listening at http://localhost:${port}/api`); | |
}); | |
server.on('error', console.error); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment