Skip to content

Instantly share code, notes, and snippets.

@muhsin-k
Created April 11, 2018 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muhsin-k/262c43578f1c4b7a2586eeb450b6d43e to your computer and use it in GitHub Desktop.
Save muhsin-k/262c43578f1c4b7a2586eeb450b6d43e to your computer and use it in GitHub Desktop.
URL-Shortener
const mongoose = require("mongoose");
const { Schema } = mongoose;
const urlShortenSchema = new Schema({
originalUrl: String,
urlCode: String,
shortUrl: String,
createdAt: { type: Date, default: Date.now },
updatedAt: { type: Date, default: Date.now }
});
mongoose.model("UrlShorten", urlShortenSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment