Skip to content

Instantly share code, notes, and snippets.

@vsavkin
Created August 8, 2019 17:05
Show Gist options
  • Save vsavkin/6961dd59fb619bfe47236052aa5ab521 to your computer and use it in GitHub Desktop.
Save vsavkin/6961dd59fb619bfe47236052aa5ab521 to your computer and use it in GitHub Desktop.
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