Skip to content

Commit

Permalink
fix(): missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
mkucharz committed Dec 18, 2017
1 parent 722d28f commit bb1ff19
Show file tree
Hide file tree
Showing 13 changed files with 105 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/template-project-empty/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@syncano/template-project-empty",
"description": "Empty Project",
"description": "Empty Project Template",
"version": "0.4.2",
"main": "src/index.js",
"license": "MIT",
Expand Down
4 changes: 4 additions & 0 deletions packages/template-project-empty/src/template/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
syncano/.dist
syncano/.bundles
syncano/**/scripts/.bundles
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
**/.dist
Empty file.
4 changes: 4 additions & 0 deletions packages/template-project-hello/src/template/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
syncano/.dist
syncano/.bundles
syncano/**/scripts/.bundles
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
**/.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
**/.bundles
**/.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh

mkdir -p .dist
babel src --out-dir .dist/src --copy-files
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh

mkdir -p .dist
cp package.json .dist
cd .dist
yarn --production
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"license": "MIT",
"dependencies": {
"@syncano/core": "latest"
},
"scripts": {
"build": "yarn && ./bin/compile && ./bin/compile-env",
"build:src": "./bin/compile",
"build:env": "./bin/compile-env"
},
"devDependencies": {
"babel-core": "^6.26.0"
},
"babel": {
"presets": [
[
"env",
{
"targets": {
"node": "8"
}
}
]
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: hello
description: Hello World Socket
version: 0.0.1
runtime: nodejs_v8

endpoints:
hello:
description: Hello world!
parameters:
firstname:
type: string
description: First name of the person you want to greet
example: Tyler
lastname:
type: string
description: Last name of the person you want to greet
example: Durden
response:
success:
description: Success
parameters:
message:
description: Hello message
example: |
{
"message": "Hello Tyler Durden!"
}
fail:
exit_code: 400
description: Failed
parameters:
message:
description: Error message

example: |
{
"message": "You have to send "firstname" and "lastname" arguments!"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Syncano from '@syncano/core'

export default (ctx) => {
const {response} = new Syncano(ctx)

if (ctx.args.firstname && ctx.args.lastname) {
response.json({
message: `Hello ${ctx.args.firstname} ${ctx.args.lastname}!`
})
} else {
response.json({
message: 'You have to send "firstname" and "lastname" arguments!'
}, 400)
}
}
Empty file.

0 comments on commit bb1ff19

Please sign in to comment.