Git Product home page Git Product logo

express-svelte-template's Introduction

express-svelte-template

This is a project template for Express and Svelte apps. It includes basic TypeScript setup and Jest tests setup for the backend.

To create a new project based on this template using degit:

npx degit somi92/express-svelte-template my-app
cd my-app

Note that you will need to have Node.js installed.

Get started

Change appropriate project fields in package.json (name, version and description).

Install the dependencies:

cd my-app
npm install

Development mode

Start development mode:

npm run dev:live

The script will run the backend and frontend build processes in parallel.

Backend Express API will be started on localhost:8080. Navigate to localhost:8080/hello to see a sample response. Make a change to TypeScript (.ts) file in src, save it and reload the page to see your changes.

Navigate to localhost:5000. You should see your frontend Svelte app running. Edit a component file in src/client, save it and the page should automatically reload so you can see your changes.

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.

Production build

Run production build:

npm run prod

The script will run the production build process which outputs its results in the dist directory. You can run the production build locally with:

npm run prod:start

Navigate to localhost:8080 to see your app running (both the API and the frontend are served from localhost:8080).

To run the both scripts in one go:

npm run prod:live

Tests

Run the backend tests with:

npm run test

To run the tests in watch mode (tests will re-run on save):

npm run test:watch

License

MIT License.

express-svelte-template's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.