Personal blog written from scratch using Node.js, Bootstrap, and MySQL. https://jrtechs.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

22 lines
390 B

const routes = require('express').Router();
const sql = require('../../utils/sql');
routes.get('/posts', (request, result) =>
{
sql.getAllPosts().then((data)=>
{
result.json(data).end();result
}).catch((err)=>
{
result.status(500).json([]).end();
});
});
routes.get('*', (request, result) =>
{
result.json([]).end();
});
module.exports = routes;