Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
Auto-format README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Jun 8, 2021
1 parent 0d74351 commit d096677
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ module.exports = {
name: g.name,
address: {
zip: g.zipUS,
city: g.city,
},
},
city: g.city
}
}
};
```

Expand All @@ -107,7 +107,7 @@ module.exports = {
size: () => _.random(2, 10),
collection: false,
callback: response.generate,
render: response.render,
render: response.render
};
```

Expand Down Expand Up @@ -148,17 +148,17 @@ module.exports = {
template: user.template,
container: {
meta: (params, query, data) => ({
userCount: data.length,
userCount: data.length
}),
data: {
all: [],
the: {
way: {
here: (params, query, data) => data,
},
},
},
},
here: (params, query, data) => data
}
}
}
}
};
```

Expand Down Expand Up @@ -211,7 +211,7 @@ module.exports = {
res.status(404);
}
next();
},
}
};
```

Expand All @@ -237,24 +237,25 @@ module.exports = {
} else {
res.send(res.body);
}
},
}
};
```

## FILE UPLOAD
## File Upload

Ex: return file name<br/>
formDataName = 'file'

``` javascript
```javascript
module.exports = {
render: (req, res) => {
if (callback) {
res.send({fileName: req.files.file.name});
res.send({ fileName: req.files.file.name });
} else {
res.send(res.body);
}
}
}
};
```

## HTTPS
Expand All @@ -269,8 +270,8 @@ const app = dyson.createServer({
port: 3001,
https: {
key: fs.readFileSync(`${__dirname}'/certs/sample.key`),
crt: fs.readFileSync(`${__dirname}/certs/sample.crt`),
},
crt: fs.readFileSync(`${__dirname}/certs/sample.crt`)
}
});
```

Expand All @@ -285,7 +286,7 @@ npm install dyson-graphql --save-dev
```

```javascript
const dysonGraphQl = require("dyson-graphql");
const dysonGraphQl = require('dyson-graphql');

const schema = `
type User {
Expand All @@ -308,13 +309,13 @@ module.exports = {
method: 'POST',
render: dysonGraphQl(schema)
.query('currentUser', { id: 987, name: 'Jane Smart' })
.mutation("createUser", ({ name }) => ({ id: 456, name }))
.mutation("updateUser", ({ id, name }) => {
.mutation('createUser', ({ name }) => ({ id: 456, name }))
.mutation('updateUser', ({ id, name }) => {
if (id < 1000) {
return { id, name };
}

throw new Error('Can\'t update user');
throw new Error("Can't update user");
})
.build()
};
Expand All @@ -331,7 +332,7 @@ const path = require('path');

const options = {
configDir: path.join(__dirname, 'services'),
port: 8765,
port: 8765
};

const configs = dyson.getConfigurations(options);
Expand All @@ -349,7 +350,7 @@ const dyson = require('./lib/dyson');
const path = require('path');

const options = {
configDir: path.join(__dirname, 'services'),
configDir: path.join(__dirname, 'services')
};

const myApp = express();
Expand Down

0 comments on commit d096677

Please sign in to comment.