GithubHelp home page GithubHelp logo

aswa-mongoose-tutorial's Introduction

Static Web Apps - Mongoose starter

This project is designed to be a starter creating sites using Azure Static Web Apps, with Azure Cosmos DB API for Mongo DB as a database and a Mongoose client. It's built with the following:

Azure deployment

Please refer to the documentation for information on creating the appropriate server resources and deploying the project.

Local development

You can run the project locally using containers by following the local setup instructions.

Project structure

This starter project is heavily commented and designed to be both a template and learning tool. The key files you'll want to be aware of:

package.json

At the root of the project is package.json, which consists of a dev script for starting the server, and references to both Vite and Azure Static Web Apps CLI to enable running the project locally.

vite.config

Configuration file for Vite, which instructs the service to use public as the root for the client.

public

Root folder for the client and index.html, style.css and script.js. script.js contains the code to interact with the server and is heavily commented.

api

Root folder for Azure Functions. All new serverless functions are added to this directory.

api/store.js

The data store for the project. Contains one Mongoose model for TaskModel, methods for interacting with the database, and logic to start the MongoDB Memory Server if no connection string is provided.

NOTE: Note the environment variable of CONNECTION_STRING. This must be set for the application to use an external database.

api/tasks/index.js

The code for Azure Functions is placed in a folder for each function and named index.js. It contains the code to get the current user information and use connect to the database and perform the operation.

aswa-mongoose-tutorial's People

Contributors

komiyasa avatar

Watchers

 avatar

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.