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 axios = require('axios') | |
const env = require('./.env') | |
const cron = require('node-cron') | |
require('./config/database') | |
const accessToken = require('./api').accessToken | |
const userValidate = require('./api').userValidate | |
const getOrders = require('./api').getOrders | |
const getSetup = require('./api').getSetup |
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
(SELECT ek_vend_comp.nome as nome_vend, | |
ek_vend_comp.cod_vend_comp, | |
coalesce(ek_vend_comp.perc_comissao,0) as perc_comissao, | |
ek_financeiro_receber.valor_pago | |
FROM ek_vend_comp | |
inner join ek_pedido_cli | |
inner join ek_financeiro_receber on ek_pedido_cli.seq_pedido_cli = ek_financeiro_receber.seq_pedido | |
on ek_vend_comp.cod_vend_comp = ek_pedido_cli.cod_vend_comp | |
WHERE (case when 0 = 1 then (CASE WHEN 0 <> 0 THEN ek_vend_comp.cod_vend_comp = 0 ELSE 1=1 END) else | |
ek_vend_comp.cod_vend_comp < 0 end) and ek_vend_comp.cod_vend_comp in |
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
type Query { | |
me: User | |
} | |
type User { | |
id: ID | |
name: String | |
} |
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 { graphql, buildSchema } = require('graphql') | |
// Construa um esquema, usando o idioma do esquema GraphQL | |
const schema = buildSchema(` | |
type Query { | |
hello: String | |
} | |
`) | |
// O root fornece uma função de resolução para cada endpoint da API |
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
"scripts": { | |
"dev": "next", | |
"build": "next build", | |
"start": "next start" | |
}, |
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
import Header from '../components/Header' | |
export default () => ( | |
<div> | |
<Header /> | |
<p>React on server-side</p> | |
</div> | |
) |
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
import Router from 'next/router' | |
export default () => ( | |
<div> | |
<Link href='/'>Home</Link> | |
<Link href='/about'>About</Link> | |
<Link href='/blog'>Blog</Link> | |
</div> | |
) |
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
import Header from '../components/Header' | |
export default () => ( | |
<div> | |
<Header /> | |
<p>Nextjs love you.</p> | |
</div> | |
) |
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
import { Component } from 'react' | |
import Header from '../components/Header' | |
export default class extends Component { | |
static getInitialProps () { | |
return { data: 'My personal blog' } | |
} | |
render () { | |
return ( |
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 express = require('express'), | |
restful = require('node-restful'), | |
mongoose = restful.mongoose; | |
const app = express() | |
const Resource = restful.model('resource', mongoose.Schema({ | |
title: 'string', | |
year: 'number', | |
}) | |
.methods(['get', 'post', 'put', 'delete']) |