-
Install nodejs
-
Install gt
sudo npm install -g granturismo -
Add scaffold into gt
gt config add vivaxy/gt-node-server https://github.com/vivaxy/gt-node-server.git -
Create your project directory
mkdir my-project-name && cd my-project-nameorgit clone ... -
Run
gt init -
Select
vivaxy/gt-node-server
Feel free to submit any issue.
Steps to make contributions
- Update codes
- Submit your changes by
gacp - Run
npm run releaseto updateCHANGELOG.mdand bump version - Run
gacpto push changes into origin
A node server
- React SSR
- EJS template
- log4js logger
npm run dev- Open in browser
http://127.0.0.1:8080
SSR: http://127.0.0.1:8080/demo/render-react?ssr=1
CSR: http://127.0.0.1:8080/demo/render-react
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d 'id=3' "http://127.0.0.1:8080/demo/1?id=2" =>
> {"code":0,"data":{"body":{"id":"3"},"query":{"id":"2"},"params":{"id":"1"},"args":{"id":"3"}}}
npm start
exports.argTypes = {
name: ArgTypes.string.isRequired,
age: ArgTypes.number
};
exports.defaultArgs = {
age: 18
};
exports.get = function get({ args, httpStatusCodes }) {
return {
status: httpStatusCodes.OK,
body: args,
}
};
exports.post = function post({ args, httpStatusCodes }) {
return {
status: httpStatusCodes.OK,
body: args,
}
}