GithubHelp home page GithubHelp logo

the-urlist / backend-csharp Goto Github PK

View Code? Open in Web Editor NEW
46.0 4.0 11.0 1.33 MB

A C# / Azure Functions implementation of the API for https://www.theurlist.com

License: MIT License

C# 100.00%
csharp azure-functions opengraph cosmosdb

backend-csharp's Introduction

The Urlist - Backend

Build status License

The backend for this project was built as a serverless API using Azure Functions and .NET. All the data is stored in a Cosmos DB collection using the SQL API.

Build and run the backend locally

Get the prerequisites

Optional

Run the serverless backend

Navigate into backend folder

cd /src/LinkyLink

Build the project

dotnet build

Rename the local.settings.sample.json file to local.settings.json

Linux & MacOS

mv local.settings.sample.json local.settings.json

Windows command line

REN local.settings.sample.json local.settings.json

Update the local.settings.json file with your Application Insights key to the APPINSIGHTS_INSTRUMENTATIONKEY setting. You could also just remove this if you don't want to use Application Inisghts.

Create an a Cosmos DB instance in Azure using the SQL API. Update the local.settings.json file with your Cosmos DB connection string in the LinkLinkConnection settings. This database will initially be empty. If you try out the API with Postman (see below), the collection and sample documents will be created for you automatically. Otherwise it's structure will be created when you create your first list through the frontend.

Start the function via the command line

func start

func start

Alternatively, start a debuging session in Visual Studio or Visual Studio Code.

Try out the API with Postman

  • Start up Postman and import the theurlist_collection.json file that's in the backend folder
  • Next import the theurlist_localhost_env.json file. That includes the Localhost environment settings.
  • Set your environment to Localhost

postman

  • Run Save Bundle to add some data to Cosmos DB. The structure (collection, documents, etc.) in the database will be created for you if it does not exsist yet. Next run Get bundle for vanity url to retrieve the entry you just created.

If everything was setup correctly, your should see a response that resembles the following.

postman

backend-csharp's People

Contributors

burkeholland avatar cecilphillip avatar ptjuanramos avatar rickvdbosch avatar vnbaaij avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

backend-csharp's Issues

Add "/" as acceptable URL character

Right now we disallow the "/" character. Having one would make it possible to "namespace" links and also vastly increases the available permutations and decrease collisions.

This would be paticularly helpful for people who have recurring themes like...

theurlist.com/twitch/some-links
theurlist.com/build/some-session
theurlist.com/username/all-a-users-links

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.