Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
const express = require('express');
const router = express.Router();
const mainController = require('../controllers');
const pj = require('../package.json');
/* GET home page. */
router.get('/', (req, res) => {
res.status(200).json({ name:, version: pj.version});
/* Create a short URL */'/', mainController.saveUrl);
/* Get original URL */
router.get('/:code', mainController.getUrl);
module.exports = router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.