post-test

Post Test

Post test for svelte to resolve back-end

create-svelte

Everything you need to build a Svelte project, powered by create-svelte;

Creating a project

If you're seeing this, you've probably already done this step. Congrats!

# create a new project in the current directory
npm init svelte@next

# create a new project in my-app
npm init svelte@next my-app

Note: the @next is temporary

Developing

Once you've created a project, install dependencies with

npm install 

or


pnpm install 

or

yarn start

Next Change the port in your package.json file so that your svelteapp will be running on to port 9000 as follows:

and save your changes

Next start a development server using:

npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

Building

Before creating a production version of your app, install an adapter for your target environment. Then:

npm run build

You can preview the built app with npm run preview, regardless of whether you installed an adapter. This should not be used to serve your app in production. Note: You need to setup your resolve framework as well

Setting Up Resolve

To understand how to use the resolve framework more better go to resolve framework site

To setup your resolve app locally make sure you have npx, nvm, npm installed which you probably already have installed because you would have had to use it in setting up the sveltekit as well. To install the framework use:

npx create-resolve-app my-resolve-backend

Bonus Step

Note: If you do this Bonus step you don't have to setup a whole new Resolve Project.

Just redirect to my other repo

Now wether you create a new project or not you will still have to follow these steps below to enable your sveltekit app run with resolve

First Change Your Event Types at /common/event-types.js:

Next change the list of Commands as follows at coommon/aggregates/my-aggregate.commands.js

Next Change you Projection at /common/aggregates/my-aggregate.projection.js

Next To register your Aggregates and Your viewModel go to your /config.app.js and let it look like this:

Once all the changes are done start your server by running


npm run dev

Shortcut

If you can't or don't wanna do all that for the resolve backend then go to this other of my repo and clone it then just locate the folder, run

npm install 

Then


npm run dev

Happy Development :-)

Top categories

Loading Svelte Themes