This file contains 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'); | |
const graphqlHTTP = require('express-graphql'); | |
const mongo = require('mongoose'); | |
const app = express(); | |
const schema = require('./schema/schema'); | |
mongo.connect('mongodb://mongo:27017/example', { | |
useNewUrlParser: true, |
This file contains 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 = require('graphql'); | |
const Todo = require('../models/todo'); | |
const { | |
GraphQLObjectType, | |
GraphQLString, | |
GraphQLBoolean, | |
GraphQLSchema, | |
GraphQLID, |
This file contains 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 mongo = require('mongoose'); | |
const Schema = mongo.Schema; | |
const todoSchema = new Schema({ | |
title: String, | |
completed: Boolean, | |
}); | |
module.exports = mongo.model('Todo', todoSchema); |
This file contains 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
{ | |
"name": "example", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"start": "nodemon" | |
}, | |
"author": "", |
This file contains 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
FROM node:13 | |
WORKDIR /app | |
COPY package.json /app | |
RUN npm install | |
COPY . /app | |
EXPOSE 4000 | |
CMD [ "npm", "run", "start" ] |
This file contains 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
version: "3" | |
services: | |
app: | |
container_name: app | |
restart: always | |
build: . | |
volumes: | |
- ./:/app | |
- /app/node_modules | |
ports: |
This file contains 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
@{ | |
var root = CurrentPage.AncestorsOrSelf(1).First(); | |
var url = umbraco.library.NiceUrl(root.Id); | |
var withDomain = umbraco.library.NiceUrlWithDomain(root.Id); | |
} |