This project is made based on the awesome Svelte: Getting Started Pluralsight course (by Jake Trent).
It is intended to be an interactive library, where the user can add books and set them as favorites.
Clone the repository...
git clone https://github.com/rlawisch/svelte_library.git
Install the dependencies...
cd svelte_library
npm install
...then start Rollup:
npm run dev
Navigate to localhost:5000. You should see the library with a few sample books to start. If you edit a component file in src
, save it and reload the page, your changes will be there.
By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the sirv
commands in package.json to include the option --host 0.0.0.0
.
To create an optimised version of the app:
npm run build
You can run the newly built app with npm run start
. This uses sirv, which is included in your package.json's dependencies
so that the app will work when you deploy to platforms like Heroku.
Install now
if you haven't already:
npm install -g now
Then, from within the project folder:
cd public
now deploy --name svelte_library
As an alternative, use the Now desktop client and simply drag the unzipped project folder to the taskbar icon.
Install surge
if you haven't already:
npm install -g surge
Then, from within the project folder:
npm run build
surge public svelte_library.surge.sh