Skip to content

Commit c63ead5

Browse files
committed
Adding the example directory
1 parent 69747cb commit c63ead5

File tree

6 files changed

+24
-4
lines changed

6 files changed

+24
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Deploy an API to the cloud **in under 30 seconds**, *in just 3 steps*.
2121

2222
![tutorial](./tutorial.gif)
2323

24-
1) Build your domain objects as JSON Schemas, all in the same Markdown document. Alternatively, run `rx init` to get a [ready-to-use document](./sample.md) with two sample schemas.
24+
1) Build your domain objects as JSON Schemas, all in the same Markdown document. Alternatively, run `rx init` to get a [ready-to-use document](./example/sample.md) with two sample schemas.
2525

2626
2) When you run `rx generate sample.md`, you'll get a full CRUD (create-read-update-delete) Swagger specification for your API.
2727

example/contacts.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# The Contacts API
2+
3+
Here's how a contact should be defined:
4+
5+
```yaml
6+
contact:
7+
type: object
8+
required:
9+
- name
10+
properties:
11+
name:
12+
type: string
13+
description: The contact's full name
14+
email:
15+
type: string
16+
description: The contact's email address
17+
phone:
18+
type: string
19+
description: The contact's phone number
20+
```
File renamed without changes.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"/lib",
2828
"/npm-shrinkwrap.json",
2929
"/oclif.manifest.json",
30-
"sample.md"
30+
"/example/sample.md"
3131
],
3232
"engines": {
3333
"node": ">=8.0.0"

src/library/cli/init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { log } from './log'
99
*/
1010
export const init = async (directory: string): Promise<void> => {
1111
// Get the sample document (this is read from the assets directory in the final bundle)
12-
let document = await fse.readFile(path.join(__dirname, '../../../sample.md'))
12+
let document = await fse.readFile(path.join(__dirname, '../../../example/sample.md'))
1313
// Write the document to the specified directory
1414
await fse.writeFile(path.join(directory, 'sample.md'), document)
1515
log('success', 'Created the ./sample.md file successfully.')

src/library/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
let document: string
1515

1616
test.before(async t => {
17-
let file = path.join(__dirname, '../../sample.md')
17+
let file = path.join(__dirname, '../../example/sample.md')
1818
document = (await fse.readFile(file)).toString()
1919
})
2020

0 commit comments

Comments
 (0)