GeezerVison is showing github.com — Ask for PRs · SatsCzar/nullstack.github.io@c9403e9
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: i18n/en-US/examples/using-nullstack-to-build-a-desktop-application.md +3-1Lines changed: 3 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 | title: "Using Nullstack to build a Desktop Application" | 3 | 3 | description: "Nullstack can be used to build a Desktop Application" | 4 | 4 | --- | 5 | | -Nullstack can be used as to build a Desktop Application with Electron. | | 5 | +Nullstack can be used as to build a Desktop Application with Electron. | | 6 | + | | 7 | +If you'd like to help complete this example, feel free to [send us a PR](https://github.com/nullstack/nullstack.github.io). |
Collapse file Copy file name to clipboardExpand all lines: i18n/en-US/examples/using-nullstack-to-build-a-mobile-application.md +3-1Lines changed: 3 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 | title: "Using Nullstack to build a Mobile Application" | 3 | 3 | description: "Nullstack can be used to build a Mobile Application" | 4 | 4 | --- | 5 | | -Nullstack can be used as to build a Mobile Application with Capacitor. | | 5 | +Nullstack can be used as to build a Mobile Application. | | 6 | + | | 7 | +If you'd like to help complete this example, feel free to [send us a PR](https://github.com/nullstack/nullstack.github.io). |
Collapse file Copy file name to clipboardExpand all lines: i18n/pt-BR/components/Examples.yml +13-5Lines changed: 13 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -6,8 +6,16 @@ contribute: "We accept guest examples! You can write it up in markdown and open | 6 | 6 | posts: | 7 | 7 | - title: "Using Nullstack as a Web API" | 8 | 8 | href: "/examples/using-nullstack-as-a-web-api" | 9 | | - description: "Nullstack can be used as a web API, and this example shows how to do it." | 10 | | - date: "Apr, 2023" | 11 | | - author: | 12 | | - name: Bruno Michels | 13 | | - handle: BrunoLM | | 9 | + description: "Nullstack can be used as a web API, you can write your own endpoints or expose server functions." | | 10 | + - title: "Using Nullstack to build a Chrome Extension" | | 11 | + href: "/examples/using-nullstack-to-build-a-chrome-extension" | | 12 | + description: "Nullstack can be used to build a Chrome Extension." | | 13 | + - title: "Using Nullstack to build a Desktop Application" | | 14 | + href: "/examples/using-nullstack-to-build-a-desktop-application" | | 15 | + description: "Nullstack can be used to build a Desktop Application." | | 16 | + - title: "Using Nullstack to build a Mobile Application" | | 17 | + href: "/examples/using-nullstack-to-build-a-mobile-application" | | 18 | + description: "Nullstack can be used to build a Mobile Application." | | 19 | + - title: "Using Nullstack to build a personal Portfolio on GitHub" | | 20 | + href: "/examples/using-nullstack-to-build-a-personal-portfolio-on-github" | | 21 | + description: "Nullstack can be used to build a personal Portfolio on GitHub." |
Collapse file Copy file name to clipboard +33-6Lines changed: 33 additions & 6 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | --- | 2 | 2 | title: "Using Nullstack as a Web API" | 3 | | -description: "Nullstack can be used as a web API, and this example shows how to do it." | 4 | | -date: "Apr, 2023" | 5 | | -author: | 6 | | - name: Bruno Michels | 7 | | - handle: BrunoLM | | 3 | +description: "Nullstack can be used as a web API, you can write your own endpoints or expose server functions." | 8 | 4 | --- | 9 | | -example | | 5 | +Nullstack can be used as a Web API. Nullstack runs an Express server behind the scenes allowing you to configure your own routes and build a fully customized Web API. | | 6 | + | | 7 | +You can configure the Express routes by using the `server` object available in the Nullstack Context on `server.js`. | | 8 | + | | 9 | +```js | | 10 | +// server.js | | 11 | +import Nullstack from 'nullstack'; | | 12 | +import Application from './src/Application'; | | 13 | + | | 14 | +const context = Nullstack.start(Application); | | 15 | + | | 16 | +context.server.get('/api/waifus', (request, response) => { | | 17 | + response.json({waifus: []}); | | 18 | +}); | | 19 | + | | 20 | +export default context; | | 21 | +``` | | 22 | + | | 23 | +It's also possible to expose server functions from your components to be in the web API. Instead of using a function that a `request` and a `response` pass the static function from your component to the express route. | | 24 | + | | 25 | +```js | | 26 | +// server.js | | 27 | +import Nullstack from 'nullstack'; | | 28 | +import Application from './src/Application'; | | 29 | +import WaifuComponent from './src/WaifuComponent'; | | 30 | + | | 31 | +const context = Nullstack.start(Application); | | 32 | + | | 33 | +context.server.get('/waifus', WaifuComponent.getWaifus) | | 34 | + | | 35 | +export default context; | | 36 | +``` |
Collapse file Copy file name to clipboard +14Lines changed: 14 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +--- | | 2 | +title: "Using Nullstack to build a Chrome Extension" | | 3 | +description: "Nullstack can be used to build a Chrome Extension" | | 4 | +--- | | 5 | +Nullstack can be used as to build a Chrome Extension. | | 6 | + | | 7 | +These are all the changes required to make the app compatible as an extension: | | 8 | + | | 9 | +- `public/manifest.json` creates the Chrome Extension manifest file | | 10 | +- `server.js` disables the default service worker, as the extension doesn't need it | | 11 | +- `src/Application.jsx` is the entry component that will render the Popup code | | 12 | +- `package.json` sets mode to SPA (default mode) and enables writing files to disk | | 13 | + | | 14 | +You can find a full example at [Mortaro/nullstack-chrome-extension](https://github.com/Mortaro/nullstack-chrome-extension). |
Collapse file Copy file name to clipboard +7Lines changed: 7 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +--- | | 2 | +title: "Using Nullstack to build a Desktop Application" | | 3 | +description: "Nullstack can be used to build a Desktop Application" | | 4 | +--- | | 5 | +Nullstack can be used as to build a Desktop Application with Electron. | | 6 | + | | 7 | +If you'd like to help complete this example, feel free to [send us a PR](https://github.com/nullstack/nullstack.github.io). |
Collapse file Copy file name to clipboard +7Lines changed: 7 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +--- | | 2 | +title: "Using Nullstack to build a Mobile Application" | | 3 | +description: "Nullstack can be used to build a Mobile Application" | | 4 | +--- | | 5 | +Nullstack can be used as to build a Mobile Application. | | 6 | + | | 7 | +If you'd like to help complete this example, feel free to [send us a PR](https://github.com/nullstack/nullstack.github.io). |
Collapse file Copy file name to clipboard +7Lines changed: 7 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +--- | | 2 | +title: "Using Nullstack to build a personal Portfolio on GitHub" | | 3 | +description: "Nullstack can be used to build a personal Portfolio on GitHub" | | 4 | +--- | | 5 | +Nullstack can be used to build a personal Portfolio on GitHub. | | 6 | + | | 7 | +Check out how to [deploy your website to GitHub pages](/how-to-deploy-to-github-pages). |
|