This file contains hidden or 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
'use strict'; | |
const mongoose = require('mongoose'); | |
module.exports = (app) => { | |
const tasksSchema = mongoose.Schema({ | |
title: String, | |
done: { | |
type: Boolean, |
This file contains hidden or 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
'use strict'; | |
const express = require('express'); | |
module.exports = (app) => { | |
const router = express.Router(); | |
router.get('/', (req, res) => { |
This file contains hidden or 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
'use strict'; | |
const express = require('express'); | |
const { version } = require('../package'); | |
module.exports = () => { | |
const router = express.Router(); | |
router.get('/', (req, res) => { |
This file contains hidden or 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
const app = {}; | |
consign() | |
.include('api') | |
.into(app); | |
const flattened = flatten(app); | |
Object.entries(flattened).forEach(([route, router]) => { | |
const baseRoute = `/${route.replace(/\.controller$/, '').replace(/\./g, '/')}`; |
This file contains hidden or 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
'use strict'; | |
const express = require('express'); | |
module.exports = () => { | |
const router = express.Router(); | |
router.get('/', (req, res) => { | |
res.json([]); | |
}); | |
This file contains hidden or 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
'use strict'; | |
require('dotenv').config(); | |
const express = require('express'); | |
const app = express(); | |
const helmet = require('helmet'); | |
const pino = require('pino'); | |
const logger = pino({ | |
level: process.env.LOG_LEVEL |
This file contains hidden or 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
<span aria-current="page" class="page-numbers current">1</span> | |
<a class="page-numbers" href="/blog/category/fun-and-social/page/2">2</a> | |
<a class="page-numbers" href="/blog/category/fun-and-social/page/3">3</a> | |
<span class="page-numbers dots">…</span> | |
<a class="page-numbers" href="/blog/category/fun-and-social/page/7">7</a> |
This file contains hidden or 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
<?php | |
$pagination = paginate_links( array( | |
'base' => get_pretty_url($currentMarket, $currentCategory) . '%_%', | |
'format' => '/page/%#%', | |
'current' => $paged, | |
'total' => $posts->pagination()->total, | |
'prev_next' => false | |
)); | |
function get_pretty_url( $root, $marketSlug, $topicSlug ) { |
This file contains hidden or 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
<?php | |
add_action('pre_get_posts', function($query) { | |
if ($query->is_home() && $query->is_main_query()) { | |
$query->set('posts_per_page', 8); | |
$currentMarket = get_query_var('market'); | |
$currentCategory = get_query_var('category'); | |
$taxQuery = getTaxonomyQuery($currentMarket, $currentCategory); | |
if ($taxQuery) { |
This file contains hidden or 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
<?php | |
add_action( 'init', function () { | |
add_rewrite_rule('blog/market/([^/]+)/category/([^/]+)/page/([0-9]{1,})/?$', 'index.php?pagename=blog&pg=$matches[3]&market=$matches[1]&category=$matches[2]', 'top'); | |
add_rewrite_rule('blog/market/([^/]+)/category/([^/]+)/?$', 'index.php?pagename=blog&market=$matches[1]&category=$matches[2]', 'top'); | |
add_rewrite_rule('blog/market/([^/]+)/page/([0-9]{1,})/?$', 'index.php?pagename=blog&pg=$matches[2]&market=$matches[1]', 'top'); | |
add_rewrite_rule('blog/market/([^/]+)/?$', 'index.php?pagename=blog&market=$matches[1]', 'top'); | |
add_rewrite_rule('blog/category/([^/]+)/page/([0-9]{1,})/?$', 'index.php?pagename=blog&paged=$matches[2]&category=$matches[1]', 'top'); | |
add_rewrite_rule('blog/category/([^/]+)/?$', 'index.php?pagename=blog&category=$matches[1]', 'top'); |
NewerOlder